lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Pang <>
Subject Lucene 5.2.0 global ordinal based query time join on multiple indexes
Date Mon, 20 Jul 2015 21:48:46 GMT

Does the Global Ordinal based query time join support joining on multiple

>From my testing on 2 indexes with a common join field, the document ids I
get back from the ScoreDoc[] when searching are incorrect, though the
number of results is the same as if I use the older join query.

For the parent (to) index, the value of the join field is unique to each

For the child (from) index, multiple documents can have the same value for
the join field, which must be found in the parent index.

Both indexes have a join field indexed with SortedDocValuesField.

The parent index had 7 segments and child index had 3 segments.

Ordinal map is built with:

    SortedDocValues[] values = new SortedDocValues[searcher1


    for (LeafReaderContext leadContext : searcher1.getIndexReader()

        .leaves()) {

      values[leadContext.ord] = DocValues.getSorted(leadContext.reader(),



    MultiDocValues.OrdinalMap ordinalMap = null;

    ordinalMap =

        .getCoreCacheKey(), values, PackedInts.DEFAULT);

Join Query:

joinQuery = JoinUtil.createJoinQuery("join_field",


          new TermQuery(new Term("type", "to")), searcher2,

          ScoreMode.Max, ordinalMap);



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