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

java.lang.Object
  extended by net.derquinse.common.reflect.This<B>
      extended by net.conquiris.lucene.document.FieldBuilder<B>
          extended by net.conquiris.lucene.document.IndexableFieldBuilder<B>
              extended by net.conquiris.lucene.document.BaseTextFieldBuilder<B>
All Implemented Interfaces:
IsIndexedFlag, IsStoredFlag
Direct Known Subclasses:
BaseDocumentBuilder.DocTextFieldBuilder, TextFieldBuilder

public abstract class BaseTextFieldBuilder<B extends BaseTextFieldBuilder<B>>
extends IndexableFieldBuilder<B>

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

Author:
Andres Rodriguez

Field Summary
 
Fields inherited from interface net.conquiris.schema.IsStoredFlag
STORED
 
Fields inherited from interface net.conquiris.schema.IsIndexedFlag
INDEXED
 
Method Summary
 Field build(Reader reader)
          Builds an indexed, tokenized but not stored field with the current term vector information.
 Field build(String value)
          Builds a field with the current information and the provided value.
 Field build(TokenStream tokenStream)
          Builds an indexed, tokenized but not stored field with the current term vector information.
 B index(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(Field.TermVector vector)
          Sets whether to store term vectors.
 
Methods inherited from class net.conquiris.lucene.document.IndexableFieldBuilder
index, isIndexed, isStored, 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(@Nullable
                     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
                      Field.TermVector vector)
Sets whether to store term vectors. They will not be stored if the argument is null.


build

public final 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 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 Field build(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.