[ https://issues.apache.org/jira/browse/LUCENE-8490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16609149#comment-16609149 ]
David Smiley commented on LUCENE-8490: -------------------------------------- Now that I look at the patch, I don't really like this idea. Feature produces a Weight which produces a Scorer which has a DocIdSetIterator, so we still have something that could theoretically selectively match some documents but not others, which seems wrong to me. Stepping back a bit, perhaps we _already_ have mostly what we need – DoubleValuesSource (thanks for adding this to Lucene, by the way). Shouldn't LongPoint.newDistanceFeatureQuery and the methods you refer to in FeatureField return a DoubleValuesSource that can then easily be incorporated into another Query? And perhaps we should add BooleanQuery.Builder.addScore(DoubleValueSource)? Heck, that latter could happen independently of possible changes to LongPoint and FeatureField. Although like your patch there is a subtle problem: If the query only has some SHOULD clauses then we don't want to call this new method here and suddenly have all documents match if we "just" wrap the DoubleValueSource in a query. Instead we need to wrap the entire built query in something like a FunctionScoreQuery. > Separate scoring features from Queries > -------------------------------------- > > Key: LUCENE-8490 > URL: https://issues.apache.org/jira/browse/LUCENE-8490 > Project: Lucene - Core > Issue Type: New Feature > Reporter: Alan Woodward > Assignee: Alan Woodward > Priority: Major > Attachments: LUCENE-8490.patch > > > We currently have two types of 'purely scoring' queries, produced by static > methods on FeatureField and more recently on LongPoint (for distance or > recency boosting). These don't really make sense as standalone queries, and > are designed to be used as supplementary SHOULD clauses in boolean queries. > I think these would be easier to use (and would prevent misuses, such as > using them in FILTER or MUST clauses) if we designated them as Features > instead, with a separate class hierarchy, and add a specific feature() method > to BooleanQuery.Builder. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org