0
votes

I have a following field in SOLR schema.

<fieldType name="integer" class="solr.IntField" omitNorms="true"/> <field name="id" type="integer" indexed="true" stored="true" required="false" multiValued="false"/>

If I issue following query:

id:(1234 OR 2345 OR 3456)

SOLR does not return the documents in that order. It is giving document with id 3456, then with 1234 and then with 2345.

How do I get it in the same order as in the query?

1

1 Answers

0
votes

Your problem is that by default Solr is sorting the documents by score (which if there is no text query is often times very random). You can do a workaround by adding a sort by in the query url like this: sort=id+asc%2C+score+desc.