lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: Accumulating facets over a MultiReader
Date Tue, 02 Jul 2013 03:25:12 GMT
Hi,

I assume that you use a single TaxonomyReader instance? It must be the same
for both indexes, that is, both indexes must share the same taxonomy index,
or otherwise their ordinals would not match as well as you may hit such
exceptions since one index may have bigger ordinals than what the taxonomy
reader knows about.

Can you share a little bit about your scenario and why do you need to use a
MultiReader?

Shai



On Tue, Jul 2, 2013 at 3:31 AM, Peng Gao <pgao@esri.com> wrote:

> How do I accumulate counts over a MultiReader (2 IndexReader)?
> The following code causes an IOException:
>
>       ArrayList<FacetRequest> facetRequests = new
> ArrayList<FacetRequest>();
>       for (String groupField : groupFields)
>         facetRequests.add(new CountFacetRequest(new
> CategoryPath(groupField, '/'), 1));
>
>       FacetSearchParams facetSearchParams = new
> FacetSearchParams(facetRequests);
>       StandardFacetsAccumulator accumulator = new
> StandardFacetsAccumulator(facetSearchParams, reader, taxonomyReader);
>       FacetsCollector facetsCollector =
> FacetsCollector.create(accumulator);
>
>       // perform documents search and facets accumulation
>       searcher.search(query, facetsCollector);
>
>       // return facets results in a proper format
>       return getFacetResults(facetsCollector, sr);
>
>
> Here reader is a MultiReader of 2. I am using Lucene 4.3.1.
>
> The following is the callstack. It looks like it has something to do with
> the MultiReader.
> How do I make it work?
>
>
> java.io.IOException: PANIC: Got unexpected exception while trying to
> get/calculate total counts
>       at
> org.apache.lucene.facet.search.StandardFacetsAccumulator.accumulate(StandardFacetsAccumulator.java:156)
>       at
> org.apache.lucene.facet.search.StandardFacetsAccumulator.accumulate(StandardFacetsAccumulator.java:378)
>       at
> org.apache.lucene.facet.search.FacetsCollector.getFacetResults(FacetsCollector.java:214)
>       at
> com.esri.arcgis.search.SearchHandler.getFacetResults(SearchHandler.java:551)
>       at
> com.esri.arcgis.search.SearchHandler.search(SearchHandler.java:350)
>       at
> com.esri.arcgis.search.SearchHandler.search(SearchHandler.java:239)
>       at
> com.esri.arcgis.search.test.Searcher.invokeSearch(Searcher.java:58)
>       at com.esri.arcgis.search.test.Searcher.main(Searcher.java:32)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 34
>       at
> org.apache.lucene.facet.search.CountingAggregator.aggregate(CountingAggregator.java:43)
>       at
> org.apache.lucene.facet.search.StandardFacetsAccumulator.fillArraysForPartition(StandardFacetsAccumulator.java:309)
>       at
> org.apache.lucene.facet.search.StandardFacetsAccumulator.accumulate(StandardFacetsAccumulator.java:168)
>       at
> org.apache.lucene.facet.complements.TotalFacetCounts.compute(TotalFacetCounts.java:176)
>       at
> org.apache.lucene.facet.complements.TotalFacetCountsCache.computeAndCache(TotalFacetCountsCache.java:157)
>       at
> org.apache.lucene.facet.complements.TotalFacetCountsCache.getTotalCounts(TotalFacetCountsCache.java:104)
>       at
> org.apache.lucene.facet.search.StandardFacetsAccumulator.accumulate(StandardFacetsAccumulator.java:129)
>       ... 7 more
>
>
>
>
>
>

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