net.conquiris.lucene.document
Class BaseFieldBuilder<B extends BaseFieldBuilder<B>>

java.lang.Object
  extended by net.derquinse.common.reflect.This<B>
      extended by net.conquiris.lucene.document.FieldableBuilder<B>
          extended by net.conquiris.lucene.document.BaseFieldBuilder<B>
Direct Known Subclasses:
BaseDocumentBuilder.DocFieldBuilder, FieldBuilder

public abstract class BaseFieldBuilder<B extends BaseFieldBuilder<B>>
extends FieldableBuilder<B>

Base class for field builders. Fields are indexed, tokenized but not stored by default. Term vectors are not stored by default.

Author:
Andres Rodriguez

Method Summary
 org.apache.lucene.document.Field build(Reader reader)
          Builds an indexed, tokenized but not stored field with the current term vector information.
 org.apache.lucene.document.Field build(String value)
          Builds a field with the current information and the provided value.
 org.apache.lucene.document.Field build(org.apache.lucene.analysis.TokenStream tokenStream)
          Builds an indexed, tokenized but not stored field with the current term vector information.
 B index(boolean index)
          Sets whether to index the field.
 B index(org.apache.lucene.document.Field.Index index)
          Sets whether to index the field.
 B norms(boolean norms)
          Sets whether to store norms.
 B tokenize(boolean tokenize)
          Sets whether to tokenize the field.
 B vector(org.apache.lucene.document.Field.TermVector vector)
          Sets whether to store term vectors.
 
Methods inherited from class net.conquiris.lucene.document.FieldableBuilder
store, store, store
 
Methods inherited from class net.derquinse.common.reflect.This
thisValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

index

public final B index(boolean index)
Sets whether to index the field.


index

public final B index(@Nullable
                     org.apache.lucene.document.Field.Index index)
Sets whether to index the field. The field will not be indexed if the argument is null.


tokenize

public final B tokenize(boolean tokenize)
Sets whether to tokenize the field.


norms

public final B norms(boolean norms)
Sets whether to store norms.


vector

public final B vector(@Nullable
                      org.apache.lucene.document.Field.TermVector vector)
Sets whether to store term vectors. They will not be stored if the argument is null.


build

public final org.apache.lucene.document.Field build(String value)
Builds a field with the current information and the provided value.

Parameters:
value - Field value.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.

build

public final org.apache.lucene.document.Field build(Reader reader)
Builds an indexed, tokenized but not stored field with the current term vector information.

Parameters:
reader - Field value reader.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.

build

public final org.apache.lucene.document.Field build(org.apache.lucene.analysis.TokenStream tokenStream)
Builds an indexed, tokenized but not stored field with the current term vector information.

Parameters:
tokenStream - Field value token stream.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.


Copyright © 2012 Derquinse Projects.. All Rights Reserved.