lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From george treacy <george.tre...@cambia.org>
Subject Faceted Search with Parallel Indexes
Date Mon, 03 Oct 2016 23:34:32 GMT
Hello,

I am trying to do a faceted search across two parallel indexes with a 
ParallelCompositeReader.

My problem is that I only get facet results from the first reader in the 
array of composite readers. This problem only occurs after upgrading to 
Lucene version 4_7_0+.

If I switch the order of the readers, again the first one in the array 
is the only index that gives facet results.

Regards,

-iad

CompositeReader primaryReader = 
DirectoryReader.open(FSDirectory.open((new 
File("index-directory")).toPath()));
CompositeReader suppReader = DirectoryReader.open(FSDirectory.open((new 
File("supp-directory")).toPath()));
CompositeReader[] readers = {primaryReader, suppReader};
ParallelCompositeReader pcr = new ParallelCompositeReader(readers);

FacetsCollector fc = new FacetsCollector();
TopDocs td = FacetsCollector.search(searcher, new MatchAllDocsQuery(), 
10, fc);
Directory taxoDir = FSDirectory.open((new 
File("taxonomy-directory")).toPath());
TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
Facets facets = new FastTaxonomyFacetCounts(taxoReader, 
CujoFacetsConfig.getFacetsConfig(), fc);
List<FacetResult> results = facets.getAllDims(10);


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