Package org.apache.lucene.facet.search.results

Examples of org.apache.lucene.facet.search.results.IntermediateFacetResult


        TaxonomyReader taxonomyReader) {
      return new TopKFacetResultsHandler(taxonomyReader, this) {
        @Override
        public IntermediateFacetResult fetchPartitionResult(
            FacetArrays facetArrays, int offset) throws IOException {
          final IntermediateFacetResult res = super.fetchPartitionResult(facetArrays, offset);
          if (countForbiddenDimension!=null) {
            int ord = taxonomyReader.getOrdinal(new CategoryPath(countForbiddenDimension));
            assertEquals("Should not have accumulated for dimension '"+countForbiddenDimension+"'!",0,facetArrays.getIntArray()[ord]);
          }
          return res;
View Full Code Here


          // In this implementation merges happen after each
          // partition,
          // but other impl could merge only at the end.
          for (FacetRequest fr : searchParams.getFacetRequests()) {
            FacetResultsHandler frHndlr = fr.createFacetResultsHandler(taxonomyReader);
            IntermediateFacetResult res4fr = frHndlr.fetchPartitionResult(facetArrays, offset);
            IntermediateFacetResult oldRes = fr2tmpRes.get(fr);
            if (oldRes != null) {
              res4fr = frHndlr.mergeResults(oldRes, res4fr);
            }
            fr2tmpRes.put(fr, res4fr);
          }
        }
      } finally {
        facetArrays.free();
      }

      // gather results from all requests into a list for returning them
      List<FacetResult> res = new ArrayList<FacetResult>();
      for (FacetRequest fr : searchParams.getFacetRequests()) {
        FacetResultsHandler frHndlr = fr.createFacetResultsHandler(taxonomyReader);
        IntermediateFacetResult tmpResult = fr2tmpRes.get(fr);
        if (tmpResult == null) {
          continue; // do not add a null to the list.
        }
        FacetResult facetRes = frHndlr.renderFacetResult(tmpResult);
        // final labeling if allowed (because labeling is a costly operation)
View Full Code Here

        TaxonomyReader taxonomyReader) {
      return new TopKFacetResultsHandler(taxonomyReader, this) {
        @Override
        public IntermediateFacetResult fetchPartitionResult(
            FacetArrays facetArrays, int offset) throws IOException {
          final IntermediateFacetResult res = super.fetchPartitionResult(facetArrays, offset);
          if (countForbiddenDimension!=null) {
            int ord = taxonomyReader.getOrdinal(new CategoryPath(countForbiddenDimension));
            assertEquals("Should not have accumulated for dimension '"+countForbiddenDimension+"'!",0,facetArrays.getIntArray()[ord]);
          }
          return res;
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.search.results.IntermediateFacetResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.