Search code examples
google-search-appliance

GSA how to exclude items with empty metadata from results


I would need to filter some items present in the GSA index when serving results. I would need to exclude all items that have an empty value (so no value) in a specific metafield (xTopic).

I have tried adding the &requiredfields=-xTopic: to the search url but this doesn't work (the search is working fine). Any ideas if it is possible at all and what the syntax would be?


Solution

  • As far as I know, it's only possible to retrieve results with metadata-inclusions and not with exclusions. A few ideas:

    • You could include all metatags except the one you'd want to exclude. I assume this is not a workable solution...
    • ... therefore, if you have control of the metatags in the source, you could add an additional metatag to all documents you don't want to exclude and perform a search including only that metatag.

    Furthermore at least I don't have any other creative ideas. You could at least file a feature request at Google, I also filed this one a few weeks ago. The more the better!