lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-7736) Expose some IndexReader stats via DoubleValuesSources
Date Wed, 18 Oct 2017 21:57:00 GMT

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

Adrien Grand commented on LUCENE-7736:
--------------------------------------

Thanks Alan. I think those new functions are going to be useful.

bq. One wrinkle here is that we can't compare closures, so IndexReaderDoubleValuesSource only
uses its description field for comparisons. These are all private implementations, and there's
a comment to that effect, so I think this is OK.

I think this is incorrect as two instances that have been built on a different reader will
be considered equals even though they produce different values? Let's pass things that are
actually comparable to {{IndexReaderDoubleValuesSource}} or just live with the fact that two
instances that do the same thing are considered unequal (which is ok imo as long as a.equals(b)
returns true if a == b)?

Should we use == rather than equals to know whether the source was rewritten? I don't like
one more than the other but since queries already use == I'd rather like things to be consistent?

Did you remove the {{if (boost == 1f) return expl;}} from {{FunctionScoreQuery}} on purpose?
I know it is not necessary for correctness but I still like the fact that it makes the explanation
easier to read in the default case that the boost is 1.

In {{TermFreqDoubleValuesSource}} could we just return an empty instance if the term is not
found instead of having to do a null check for every document?

In {{lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java}} you seem
to be assuming that rewriting only once is enough? Is it true?



> Expose some IndexReader stats via DoubleValuesSources
> -----------------------------------------------------
>
>                 Key: LUCENE-7736
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7736
>             Project: Lucene - Core
>          Issue Type: New Feature
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Minor
>         Attachments: LUCENE-7736.patch, LUCENE-7736.patch, LUCENE-7736.patch, LUCENE-7736.patch
>
>
> We have a number of ValueSource implementations that expose IndexReader stats (numDocs,
termFreq, etc).  We should re-implement these as DoubleValuesSources, allowing them to be
used in FunctionScoreQuery, etc.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message