You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Greg Miller (Jira)" <ji...@apache.org> on 2021/08/06 18:05:00 UTC
[jira] [Commented] (LUCENE-10045) Extend ConjunctionUtils to
support LongValues and DoubleValues
[ https://issues.apache.org/jira/browse/LUCENE-10045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17394932#comment-17394932 ]
Greg Miller commented on LUCENE-10045:
--------------------------------------
Attached a draft PR for early feedback for anyone interested. I'm planning to circle back to this in a few days to write tests and polish it up, but am interested if anyone has high-level/directional feedback about this before doing so (e.g., terrible idea for some reason; completely different approach suggested; etc.)
> Extend ConjunctionUtils to support LongValues and DoubleValues
> --------------------------------------------------------------
>
> Key: LUCENE-10045
> URL: https://issues.apache.org/jira/browse/LUCENE-10045
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/search
> Affects Versions: main (9.0)
> Reporter: Greg Miller
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{ConjunctionUtils}} provides nice support for wrapping a list of DISIs or Scorers into one DISI for easy conjunctive iteration, but intersecting DISIs/Scorers with LongValues or DoubleValues remains more burdensome. We have this pattern in a few different places (particularly in faceting code, but I suspect it exists elsewhere as well):
> {code:java}
> LongValues fv = [...];
> DocIdSetIterator docs = [...];
> for (int doc = docs.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; ) {
> if (fv.advanceExact(doc)) {
> // do something
> }
> doc = docs.nextDoc();
> }{code}
> It would be nice to encapsulate this logic in a common implementation, accessible through {{ConjunctionUtils}}. Note that this works great for things like {{NumericDocValues}} since they implement DISI and can be wrapped, but LongValues/DoubleValues don't implement DISI (and can't lead iteration), so we would need a separate implementation that explicitly takes a "lead" iterator and then a collection of LongValues/DoubleValues to intersect.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org