cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Exclude products in SOLR sorting

former_member686625
Participant
0 Kudos
362

Hi Experts,

My requirement is that certain products should always come at last when solr sorting of price is applied irrespective of whether Highest or Lowest filter selected.

Just fyi, these certain product do not have any price or they will have Zero price.

Is it possible to do it via SOLR configuration?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

It is possible with SOLR schema configuration, only if products do not have price, add attribute sortMissingLast="true" in the schema for price field or its field type

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

 I have a similar requirement,did you find any solution to exclude products in solr sorting?
 

Thanks,Anusha

former_member686625
Participant
0 Kudos

Hi Anusha,

Yes. For this you need to update "schema.xml" file of SOLR. In this file, you need to add sortMissingLast="true" for the field type that you are using to index price. For example, if you are indexing price as type double, look for fieldType name="double" in schema.xml file and add sortMissingLast="true" there.

Note: This will work only if price is null.

Restart solr and reindex.