lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franck Lefebure <>
Subject Fwd: filtering query with doc id
Date Wed, 28 Mar 2018 17:24:56 GMT
I'm new here and newbie with Lucene, sorry if this first question
looks a little dumb.

In a LeafCollector.collect(doc), I would like to (optionally) perform
a query in cascade

Actually I have something that looks like :

public void collect(int docId) throws IOException {
   if (searchForJoinedDoc) {
        String joinQuery = // query involving GlobalOrdinalsQuery or
        String id =
        Query boolQuery = new BooleanQuery.Builder()
            .add(joinQuery, filter)
            .add(new TermQuery(new Term("id", id)), filter).build()
        boolean hasJoinedDoc = new
IndexSearcher(leafReaderContext).search(query, 1).totalHits == 1

Is there a better way to write this without the TermQuery ? Can I
exploit directly the docId in a filter ?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message