Reputation: 92210
I just wonder what I am supposed to use for a lookup by ID.
This thread Solr Query on Unique Integer Field seems to use a query.
But it is not what is said here: Search document by id very slow
And here: http://lucene.472066.n3.nabble.com/Solr-Unique-Key-Field-Should-Apply-on-q-search-or-fq-search-td4003066.html But I'm not reusing the same query because the lookups can be on any ID
ElasticSearch provides natively a lookup by id, someone knows what is happening under the hood of ElasticSearch lookup so that I can eventually use the same strategy with Solr?
Thanks
Upvotes: 0
Views: 475
Reputation: 52799
You should still use Filter Query cause you may search the same id some time later which would be much faster in performance in comparison to the q
query
fq
- Provide an optional filtering query.
Results of the query are restricted to searching only those results returned by the filter query. Filtered queries are cached by Solr.
They are very useful for improving the speed of complex queries.
Upvotes: 2