Package org.apache.lucene.facet.associations

Examples of org.apache.lucene.facet.associations.AssociationsFacetFields


    // Writes facet ords to a separate directory from the main index
    DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);

    // Reused across documents, to add the necessary facet fields
    FacetFields facetFields = new AssociationsFacetFields(taxoWriter);
   
    for (int i = 0; i < CATEGORIES.length; i++) {
      Document doc = new Document();
      CategoryAssociationsContainer associations = new CategoryAssociationsContainer();
      for (int j = 0; j < CATEGORIES[i].length; j++) {
        associations.setAssociation(CATEGORIES[i][j], ASSOCIATIONS[i][j]);
      }
      facetFields.addFields(doc, associations);
      indexWriter.addDocument(doc);
    }
   
    indexWriter.close();
    taxoWriter.close();
View Full Code Here


    // Writes facet ords to a separate directory from the main index
    DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir, IndexWriterConfig.OpenMode.CREATE);

    // Reused across documents, to add the necessary facet fields
    FacetFields facetFields = new AssociationsFacetFields(taxoWriter);
   
    for (int i = 0; i < CATEGORIES.length; i++) {
      Document doc = new Document();
      CategoryAssociationsContainer associations = new CategoryAssociationsContainer();
      for (int j = 0; j < CATEGORIES[i].length; j++) {
        associations.setAssociation(CATEGORIES[i][j], ASSOCIATIONS[i][j]);
      }
      facetFields.addFields(doc, associations);
      indexWriter.addDocument(doc);
    }
   
    indexWriter.close();
    taxoWriter.close();
View Full Code Here

    // Writes facet ords to a separate directory from the main index
    DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);

    // Reused across documents, to add the necessary facet fields
    FacetFields facetFields = new AssociationsFacetFields(taxoWriter);
   
    for (int i = 0; i < CATEGORIES.length; i++) {
      Document doc = new Document();
      CategoryAssociationsContainer associations = new CategoryAssociationsContainer();
      for (int j = 0; j < CATEGORIES[i].length; j++) {
        associations.setAssociation(CATEGORIES[i][j], ASSOCIATIONS[i][j]);
      }
      facetFields.addFields(doc, associations);
      indexWriter.addDocument(doc);
    }
   
    indexWriter.close();
    taxoWriter.close();
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.associations.AssociationsFacetFields

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.