[
https://issues.apache.org/jira/browse/LUCENE-8718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16790707#comment-16790707
]
John Wang commented on LUCENE-8718:
-----------------------------------
[~jpountz] The convention has been to return -1 when underlying codec does not
support a feature, maybe we can use the same convention for this? e.g. we can
create a default impl on SortedSetDocValues to return -1.
Let me describe the motivation for this:
It is common to pick SortedSetDocValues over SortedDocValues to avoid issues
when a docid has multiple values, and you don't want the indexing process to
fail. However, which most docs, or even all of the docs have only 1 value.
To get the corresponding value, even though all docs have only 1 value, you
would still need to setup a loop, which is an overhead to pay for each
iteration in the loop. However, with this api, opens doors for an optimization
opportunity where you can case it out, e.g. if (numVal == 1) {} else \{set up a
loop}, the branch prediction here would be mostly correct, and therefore almost
free.
> Add docValueCount support for SortedSetDocValues
> ------------------------------------------------
>
> Key: LUCENE-8718
> URL: https://issues.apache.org/jira/browse/LUCENE-8718
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/search
> Affects Versions: 7.7.1
> Reporter: John Wang
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> implement docValueCount method for SortedSetDocValues, see comment:
>
> [https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/index/SortedSetDocValues.java#L54]
>
> Patch/PR: https://github.com/apache/lucene-solr/pull/603
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]