You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Serhiy Bzhezytskyy (Jira)" <ji...@apache.org> on 2026/07/16 11:29:00 UTC

[jira] [Commented] (SOLR-16851) Use IndexOrDocValuesQuery for Set queries on string fields when docValues are enabled

    [ https://issues.apache.org/jira/browse/SOLR-16851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18096758#comment-18096758 ] 

Serhiy Bzhezytskyy commented on SOLR-16851:
-------------------------------------------

I looked into doing this as the string follow-up to SOLR-16846 (which added IndexOrDocValuesQuery for PointFields), and benchmarked it before proposing a change.

Mirrored SOLR-16846's NumericSearch benchmark with a StringSearch one: 2M docs, a 20-term set query (field:(v1 v2 …) via the main parser, which routes through FieldType.getSetQuery), string field with vs. without docValues. 2 forks, 5 warmup + 5 measurement iterations:
postings-only (TermInSetQuery)               6037 ops/s  (99% CI [5780, 6294])
indexed+docValues (IndexOrDocValues)  5276 ops/s  (99% CI [5215, 5337])

So for strings the docValues path is ~13% slower for this workload, and the intervals don't overlap — the opposite of the points case. This lines up with the Lucene discussion on the string/term variant ([lucene#12089|https://github.com/apache/lucene/pull/12089]), where the conclusion was that field-level statistics aren't granular enough to reliably pick postings vs. docValues for term set queries, and the "self-optimizing" approach was dropped.

Based on this I don't think a blanket IndexOrDocValuesQuery for string set queries is a win — at least not without a workload where it clearly helps (very selective lead clause, high-cardinality field, etc.). Happy to share the benchmark if useful, or dig further if someone knows a case where it should pay off. Leaving the ticket open for that discussion.

> Use IndexOrDocValuesQuery for Set queries on string fields when docValues are enabled
> -------------------------------------------------------------------------------------
>
>                 Key: SOLR-16851
>                 URL: https://issues.apache.org/jira/browse/SOLR-16851
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Tomas Eduardo Fernandez Lobbe
>            Priority: Minor
>
> Similar to SOLR-16846, we can have Set queries on string use IndexOrDocValuesQuery when docValues are enabled



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org