Package org.apache.lucene.facet.sortedset

Examples of org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState


    final IndexReader r = w.getReader();
    w.close();

    IndexSearcher s = newSearcher(r);
    final SortedSetDocValuesReaderState state = new SortedSetDocValuesReaderState(s.getIndexReader());

    final CountFacetRequest countRequest = new CountFacetRequest(new CategoryPath("dim"), 2);
    final RangeFacetRequest<LongRange> rangeRequest = new RangeFacetRequest<LongRange>("field",
                          new LongRange("less than 10", 0L, true, 10L, false),
                          new LongRange("less than or equal to 10", 0L, true, 10L, true),
View Full Code Here


      assertEquals("incorrect label returned for " + fa, fsp.facetRequests.get(0).categoryPath, facetResults.get(0).getFacetResultNode().label);
    }
   
    try {
      // SortedSetDocValuesAccumulator cannot even be created in such state
      assertNull(new SortedSetDocValuesAccumulator(new SortedSetDocValuesReaderState(indexReader), fsp));
      // if this ever changes, make sure FacetResultNode is labeled correctly
      fail("should not have succeeded to execute a request over a category which wasn't indexed as SortedSetDVField");
    } catch (IllegalArgumentException e) {
      // expected
    }
View Full Code Here

      w.forceMerge(1);
    }
    IndexReader r = w.getReader();
    w.close();

    final SortedSetDocValuesReaderState sortedSetDVState;
    IndexSearcher s = newSearcher(r);
    if (doUseDV) {
      sortedSetDVState = new SortedSetDocValuesReaderState(s.getIndexReader());
    } else {
      sortedSetDVState = null;
    }

    if (VERBOSE) {
View Full Code Here

  /** User runs a query and counts facets. */
  private List<FacetResult> search() throws IOException {
    DirectoryReader indexReader = DirectoryReader.open(indexDir);
    IndexSearcher searcher = new IndexSearcher(indexReader);
    SortedSetDocValuesReaderState state = new SortedSetDocValuesReaderState(indexReader);

    // Count both "Publish Year" and "Author" dimensions
    FacetSearchParams fsp = new FacetSearchParams(
        new CountFacetRequest(new CategoryPath("Publish Year"), 10),
        new CountFacetRequest(new CategoryPath("Author"), 10));
View Full Code Here

 
  /** User drills down on 'Publish Year/2010'. */
  private List<FacetResult> drillDown() throws IOException {
    DirectoryReader indexReader = DirectoryReader.open(indexDir);
    IndexSearcher searcher = new IndexSearcher(indexReader);
    SortedSetDocValuesReaderState state = new SortedSetDocValuesReaderState(indexReader);

    // Now user drills down on Publish Year/2010:
    FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(new CategoryPath("Author"), 10));
    DrillDownQuery q = new DrillDownQuery(fsp.indexingParams, new MatchAllDocsQuery());
    q.add(new CategoryPath("Publish Year/2010", '/'));
View Full Code Here

      }
      w.forceMerge(1);
    }
    IndexReader r = w.getReader();

    final SortedSetDocValuesReaderState sortedSetDVState;
    IndexSearcher s = newSearcher(r);
   
    if (doUseDV) {
      sortedSetDVState = new DefaultSortedSetDocValuesReaderState(s.getIndexReader());
    } else {
View Full Code Here

  /** User runs a query and counts facets. */
  private List<FacetResult> search() throws IOException {
    DirectoryReader indexReader = DirectoryReader.open(indexDir);
    IndexSearcher searcher = new IndexSearcher(indexReader);
    SortedSetDocValuesReaderState state = new DefaultSortedSetDocValuesReaderState(indexReader);

    // Aggregatses the facet counts
    FacetsCollector fc = new FacetsCollector();

    // MatchAllDocsQuery is for "browsing" (counts facets
View Full Code Here

 
  /** User drills down on 'Publish Year/2010'. */
  private FacetResult drillDown() throws IOException {
    DirectoryReader indexReader = DirectoryReader.open(indexDir);
    IndexSearcher searcher = new IndexSearcher(indexReader);
    SortedSetDocValuesReaderState state = new DefaultSortedSetDocValuesReaderState(indexReader);

    // Now user drills down on Publish Year/2010:
    DrillDownQuery q = new DrillDownQuery(config);
    q.add("Publish Year", "2010");
    FacetsCollector fc = new FacetsCollector();
View Full Code Here

      w.forceMerge(1);
    }
    IndexReader r = w.getReader();
    w.close();

    final SortedSetDocValuesReaderState sortedSetDVState;
    IndexSearcher s = newSearcher(r);
    if (doUseDV) {
      sortedSetDVState = new SortedSetDocValuesReaderState(s.getIndexReader());
    } else {
      sortedSetDVState = null;
    }

    if (VERBOSE) {
View Full Code Here

    final IndexReader r = w.getReader();
    w.close();

    IndexSearcher s = newSearcher(r);
    final SortedSetDocValuesReaderState state = new SortedSetDocValuesReaderState(s.getIndexReader());

    final CountFacetRequest countRequest = new CountFacetRequest(new CategoryPath("dim"), 2);
    final RangeFacetRequest<LongRange> rangeRequest = new RangeFacetRequest<LongRange>("field",
                          new LongRange("less than 10", 0L, true, 10L, false),
                          new LongRange("less than or equal to 10", 0L, true, 10L, true),
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState

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.