Examples of CategoryPath


Examples of org.apache.lucene.facet.taxonomy.CategoryPath

      Document doc = new Document();
      if (withContent) {
        doc.add(new StringField("f", "a", Store.NO));
      }
      if (facetFields != null) {
        facetFields.addFields(doc, Collections.singletonList(new CategoryPath("A", Integer.toString(i))));
      }
      indexWriter.addDocument(doc);
    }
   
    indexWriter.commit();
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath

    TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
    IndexSearcher indexSearcher = newSearcher(indexReader);
   
    // search for "f:a", only segments 1 and 3 should match results
    Query q = new TermQuery(new Term("f", "a"));
    FacetRequest countNoComplements = new CountFacetRequest(new CategoryPath("A"), 10);
    FacetSearchParams fsp = new FacetSearchParams(fip, countNoComplements);
    FacetsCollector fc = FacetsCollector.create(fsp , indexReader, taxoReader);
    indexSearcher.search(q, fc);
    List<FacetResult> results = fc.getFacetResults();
    assertEquals("received too many facet results", 1, results.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.