lucene-java-user mailing list archives

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



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



>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
document.

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

        .getIndexReader().leaves().size()];

    for (LeafReaderContext leadContext : searcher1.getIndexReader()

        .leaves()) {

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

          "join_field");

    }

    MultiDocValues.OrdinalMap ordinalMap = null;

    ordinalMap = MultiDocValues.OrdinalMap.build(searcher1.getIndexReader()

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


Join Query:

joinQuery = JoinUtil.createJoinQuery("join_field",

          fromQuery,

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

          ScoreMode.Max, ordinalMap);



Thanks,

Alex

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