Package org.apache.lucene.document

Examples of org.apache.lucene.document.Field


 
  public static Field createFieldUrlHash(String urlHash){
    if(urlHash == null){
      throw new NullPointerException("urlHash is NULL");
    }
    return new Field(FIELD_URL_MD5, urlHash,Field.Store.YES,Field.Index.TOKENIZED);
  }
View Full Code Here


 
  public static Field createFieldNotes(String notes){
    if(notes == null){
      throw new NullPointerException("notes is NULL");
    }
    return new Field(FIELD_NOTES, notes, Field.Store.COMPRESS, Field.Index.NO);
  }
View Full Code Here

 
  public static Field createFieldTag(String tag){
    if(tag == null){
      throw new NullPointerException("tag is NULL");
    }
    return new Field(FIELD_TAG, tag, Field.Store.NO, Field.Index.TOKENIZED);
  }
View Full Code Here

  public static Field createFieldCreatedOn(Date date){
    if(date == null){
      throw new NullPointerException("createdOn is NULL");
    }
    String createdOn = DateTools.dateToString(date,DateTools.Resolution.DAY);
    return new Field(FIELD_CREATED_ON, createdOn, Field.Store.NO,
        Field.Index.UN_TOKENIZED);
  }
View Full Code Here

  public static Field createFieldLastUpdated(Date date){
    if(date == null){
      throw new NullPointerException("lastUpdated is NULL");     
    }
    String lastUpdated = DateTools.dateToString(date,DateTools.Resolution.DAY);
    return new Field(FIELD_LAST_UPDATED, lastUpdated, Field.Store.NO,
        Field.Index.UN_TOKENIZED);
  }
View Full Code Here

    for (FacetHandler<?> handler : _runtimeFacetHandlerMap.values())
    {
      String[] vals = handler.getFieldValues(_reader,docid);
      for (String val : vals)
      {
        doc.add(new Field(handler.getName(),
                          val,
                          Field.Store.NO,
                          Field.Index.NOT_ANALYZED));
      }
    }
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

  //*-- 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) );
  ramIW.addDocument(doc);
}
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.