lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tristan Stevens <tris...@cloudera.com.INVALID>
Subject CoveringQuery based on length of multivalued field
Date Mon, 10 Dec 2018 15:56:43 GMT
Hi,
I’ve been using CoveringQuery to specify a minimum number of queries that
need to match for a document to match overall, where we use the constructor:

public CoveringQuery(Collection<Query> queries, LongValuesSource
minimumNumberMatch)

(
https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=blob;f=lucene/sandbox/src/java/org/apache/lucene/search/CoveringQuery.java
)

The second argument LogValuesSource is the name of a field which specifies
how many of the queries must match.

I think it would be a useful feature to have an alternative constructor
which allows you to specify a multiValued field, for which the length of
the field (i.e. the number of terms in the MV field) is used as the
minimumNumberMatch instead.

The implementation should be fairly simple, however I don’t know my way
around the Lucene APIs well enough to replace LongValuesSource with the
equivalent multi-valued length.

I’d be grateful for advice on whether this is a worthwhile feature, and
some advice on how I could write such a constructor. If people are happy
then I will submit a JIRA.

Thanks,
Tristan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message