Package org.apache.lucene.facet.index.params

Examples of org.apache.lucene.facet.index.params.FacetIndexingParams


  public void testRetainableAttributes() throws IOException, FacetException {
    Directory directory = newDirectory();
    TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(
        directory);

    FacetIndexingParams indexingParams = new DefaultFacetIndexingParams();
    new CategoryParentsStream(new CategoryAttributesStream(
        categoryContainer), taxonomyWriter, indexingParams);

    // add DummyAttribute and retain it, three expected
    categoryContainer.clear();
View Full Code Here


                            DirectoryTaxonomyWriter destTaxWriter) throws IOException {
    // merge the taxonomies
    destTaxWriter.addTaxonomy(srcTaxDir, map);

    int ordinalMap[] = map.getMap();
    FacetIndexingParams params = new DefaultFacetIndexingParams();

    DirectoryReader reader = DirectoryReader.open(srcIndexDir, -1);
    List<AtomicReaderContext> leaves = reader.leaves();
    AtomicReader wrappedLeaves[] = new AtomicReader[leaves.size()];
    for (int i = 0; i < leaves.size(); i++) {
View Full Code Here

    iw.addDocument(d);
  }
 
  /** Build the "truth" with ALL the facets enumerating indexes content. */
  protected Map<CategoryPath, Integer> facetCountsTruth() throws IOException {
    FacetIndexingParams iParams = getFacetIndexingParams(Integer.MAX_VALUE);
    String delim = String.valueOf(iParams.getFacetDelimChar());
    Map<CategoryPath, Integer> res = new HashMap<CategoryPath, Integer>();
    HashSet<Term> handledTerms = new HashSet<Term>();
    for (CategoryListParams clp : iParams.getAllCategoryListParams()) {
      Term baseTerm = clp.getTerm().createTerm("");
      if (!handledTerms.add(baseTerm)) {
        continue; // already handled this term (for another list)
      }
      TermEnum te = indexReader.terms(baseTerm);
View Full Code Here

  private void doTestCLParamMultiIteratorsByRequest(boolean cacheCLI) throws Exception,
      CorruptIndexException, IOException {
    // Create a CLP which generates different CLIs according to the
    // FacetRequest's dimension
    CategoryListParams clp = new CategoryListParams();
    FacetIndexingParams iParams = new DefaultFacetIndexingParams(clp);
    Directory indexDir = newDirectory();
    Directory taxoDir = newDirectory();
    populateIndex(iParams, indexDir, taxoDir);

    TaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.index.params.FacetIndexingParams

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.