Search code examples
solrsolr4

Search more than one id (UUID)


My Id field is declared as follows

 <field name="VersionId" type="uuid" indexed="true" stored="true" required="true"/>

and I query it using

 http://...:8983/solr/vault/select?q=VersionId:5d4cb2a7-198b-4e26-a003-3b0388e35820

I want to search more than one UUID. What is the correct syntax


Solution

  • As the id is fixed you can use filter query to search multiple ids would be best for performance with Filter Cache as well e.g.

    fq=VersionId:(5d4cb2a7-198b-4e26-a003-3b0388e35820 OR 5d4cb2a7-198b-4e26-a003-3b0388e35820 OR 5d4cb2a7-198b-4e26-a003-3b0388e35820 .....)