How to exclude a list of specific items from Solr search results

I’m pretty sure that happens to you to look for items that match specific criteria except  few specific ones. We all have friends that don’t  know what they want, but they know what they don’t want. (I love you baby).

In my case, the client wanted a list of case studies specific to an  industry except those that the visitor already saw.  The first thought is to get results from Solr and then filter those already seen. But what about metadata that helps us implement paging, or just get  first 10 items ? Do we need another query ? Tee answer is to sent exclusion param with our query .

Two ways to enumerates item guids to be exuded from search results

-_uniqueid:(sitecore\:\/\/web\/\{65aedc7f-bde6-45ed-bc6c-92802e02b222\}\?lang\=fr-ca\&ver\=1\&ndx\=sitecore_blog_com_index_web)  AND  -_uniqueid:(sitecore\:\/\/web\/\{e4596947-171d-4bc8-987c-f1aed437e08f\}\?lang\=fr-ca\&ver\=1\&ndx\=sitecore_blog_com_index_web)

 

-_uniqueid:(sitecore\:\/\/web\/\{65aedc7f-bde6-45ed-bc6c-92802e02b222\}\?lang\=fr-ca\&ver\=1\&ndx\=sitecore_blog_com_index_web sitecore\:\/\/web\/\{e4596947-171d-4bc8-987c-f1aed437e08f\}\?lang\=fr-ca\&ver\=1\&ndx\=sitecore_blog_com_index_web)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s