Package org.apache.lucene.facet.index

Examples of org.apache.lucene.facet.index.CategoryDocumentBuilder.build()


      Document doc = new Document();
      doc.add(new TextField(SimpleUtils.TITLE, docTitles[docNum], Field.Store.YES));
      doc.add(new TextField(SimpleUtils.TEXT, docTexts[docNum], Field.Store.NO));

      // finally add the document to the index
      categoryDocBuilder.build(doc);
      iw.addDocument(doc);
     
      nDocsAdded++;
      nFacetsAdded += facetList.size();
    }
View Full Code Here


      doc.add(new TextField(SimpleUtils.TEXT, SimpleUtils.docTexts[docNum], Field.Store.NO));

      // invoke the category document builder for adding categories to the
      // document and,
      // as required, to the taxonomy index
      categoryDocBuilder.build(doc);

      // finally add the document to the index
      iw.addDocument(doc);

      nDocsAdded++;
View Full Code Here

      TaxonomyWriter tw, String content, List<CategoryPath> categories) throws IOException,
      CorruptIndexException {
    Document d = new Document();
    CategoryDocumentBuilder builder = new CategoryDocumentBuilder(tw, iParams);
    builder.setCategoryPaths(categories);
    builder.build(d);
    d.add(new Field("content", content, Store.YES, Index.ANALYZED, TermVector.NO));
    iw.addDocument(d);
  }
 
  /** Build the "truth" with ALL the facets enumerating indexes content. */
 
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.