How can I exclude a set of document IDs from Solr result set? Essentially something like
/select?q=tag_id:367 AND NOT id:(306670,302209)
I tried it and it does not exclude documents with those id's.
Try this:
/select?q=*:*&fq=tag_id:367 AND id:[* TO *] -id:(306670 302209)
That should allow you to build out add as many ids as you want without having to add -id:302209
every time you want to eliminate an ID. The reverse is also true, you can swap the -
with a +
and force an array of values to be there as well.
Found one solution:
/select?q=tag_id:367&fq=-id:306670 AND -id:302209
Not sure whether this is the best way to do it though!