Vasily802
Vasily802

Reputation: 1858

Which Solr QueryParser is the fastest for a simple query?

I have a query like sku:(123 456 ... 999) with 9000 skus in it. Sku is a "string" type. Which QueryParser should I use to get maximum performance from Solr? Solr version is 7.2

Upvotes: 0

Views: 102

Answers (1)

MatsLindh
MatsLindh

Reputation: 52882

If these SKUs are defined as the uniqueKey for your document, you can use the Realtime Get endpoint and bypass almost everything in Solr. That'll probably be the most performant way of handling it, but it changes the expected behavior slightly (non-committed documents are returned as well, for example).

Otherwise the performance difference will probably be neglible, so go with the standard Lucene query parser. If you want to optimize it further, it's probably better to look at the query profile (i.e. if it's the same set of 9000 SKUs being requested - index a tag for those SKUs instead and query for that).

In all cases this can differ based on your document profile and your server's performance, so the strategy is usually to test it for your specific use case and get timing information for your own infrastructure.

Upvotes: 3

Related Questions