Package org.apache.lucene.document

Examples of org.apache.lucene.document.Field


  //*-- create the Lucene Index
  public void loadIndex(IndexWriter ramIW, boolean storeTermVector) throws IOException
  {
   Document doc = new Document();
   doc.add( new Field("key", getFileName(), Field.Store.YES, Field.Index.NO) );
   doc.add(new Field("contents", getContents().toString(), Field.Store.NO, Field.Index.TOKENIZED) );
   doc.add( new Field("type", getFileType(), Field.Store.YES, Field.Index.NO) );
   doc.add( new Field("category", getTextType(), Field.Store.YES, Field.Index.NO) );
   ramIW.addDocument(doc);
  }
View Full Code Here


//*-- create the Lucene Index
public void loadIndex(IndexWriter ramIW, boolean storeTermVector) throws IOException
{
  Document doc = new Document();
  doc.add( new Field("key", getFileName(), Field.Store.YES, Field.Index.NO) );
  doc.add(new Field("contents", getContents().toString(), Field.Store.NO, Field.Index.TOKENIZED) );
  doc.add( new Field("type", getFileType(), Field.Store.YES, Field.Index.NO) );
  doc.add( new Field("category", getTextType(), Field.Store.YES, Field.Index.NO) );
  ramIW.addDocument(doc);
}
View Full Code Here

  //*-- create the Lucene Index
  public void loadIndex(IndexWriter ramIW, boolean storeTermVector) throws IOException
  {
   Document doc = new Document();
   doc.add( new Field("key", getFileName(), Field.Store.YES, Field.Index.NO) );
   doc.add(new Field("contents", getContents().toString(), Field.Store.NO, Field.Index.TOKENIZED) );
   doc.add( new Field("type", getFileType(), Field.Store.YES, Field.Index.NO) );
   doc.add( new Field("category", getTextType(), Field.Store.YES, Field.Index.NO) );
   ramIW.addDocument(doc);
  }
View Full Code Here

   * Document wraps around.
   *
   * @return Field
   */
  protected Field createDocumentIDField() {
    return new Field(ENTITY_ID_TEXT, String.valueOf(getType().getId()), Store.YES, Index.UN_TOKENIZED);
  }
View Full Code Here

   * @param entity
   * @param store
   * @return Field
   */
  protected Field createIDField(int fieldConstant, IEntity entity, Store store) {
    return new Field(String.valueOf(fieldConstant), String.valueOf(entity.getId()), store, Index.UN_TOKENIZED);
  }
View Full Code Here

   * @param store
   * @return Field
   */
  protected Field createLongField(int fieldConstant, long value, Store store) {
    String valueText = NumberTools.longToString(value);
    return new Field(String.valueOf(fieldConstant), valueText, store, Index.UN_TOKENIZED);
  }
View Full Code Here

   * @param value
   * @param store
   * @return Field
   */
  protected Field createBooleanField(int fieldConstant, boolean value, Store store) {
    return new Field(String.valueOf(fieldConstant), String.valueOf(value), store, Index.UN_TOKENIZED);
  }
View Full Code Here

  protected Field createDateField(int fieldConstant, Date value, Store store) {
    if (value == null)
      return null;

    String valueText = DateTools.dateToString(value, Resolution.DAY);
    return new Field(String.valueOf(fieldConstant), valueText, store, Index.UN_TOKENIZED);
  }
View Full Code Here

   */
  protected Field createURIField(int fieldConstant, URI value, Store store, Index index) {
    if (value == null)
      return null;

    return new Field(String.valueOf(fieldConstant), value.toString(), store, index);
  }
View Full Code Here

   */
  protected Field createStringField(int fieldConstant, String value, Store store, Index index) {
    if (value == null)
      return null;

    return new Field(String.valueOf(fieldConstant), value, store, index);
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.document.Field

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.