org.apache.lucene.gdata.search.config
Class IndexSchemaField

java.lang.Object
  extended by org.apache.lucene.gdata.search.config.IndexSchemaField

public class IndexSchemaField
extends Object

Each field in the search index is defined by a instance of IndexSchemaField. The schema definition will be loaded at startup and the defined values will be set to instances of this class. Each constructed field will be passed to an instance of IndexSchema.

IndexSchemaField contains all informations about how the content from incoming entries has to be extracted and how the actual content has to be index into the lucene index.

Each field will have a defined ContentStrategy which does process the extraction of the field content from an incoming entry.

Author:
Simon Willnauer
See Also:
ContentStrategy, IndexSchema

Nested Class Summary
static class IndexSchemaField.ContentType
          Defines the ContentStrategy to use for a IndexSchemaField to extract the content from the entry
 
Field Summary
static Field.Index DEFAULT_INDEX_STRATEGY
          Default value for Field.Index
static Field.Store DEFAULT_STORE_STRATEGY
          Default value for Field.Store
 
Constructor Summary
IndexSchemaField()
          Constructs a new SchemaField
Default values: boost: 1.0 index: TOKENIZED store: NO
 
Method Summary
 Class<? extends Analyzer> getAnalyzerClass()
           
 float getBoost()
           
 IndexSchemaField.ContentType getContentType()
           
 Class<? extends ContentStrategy> getFieldClass()
           
 Field.Index getIndex()
           
 String getName()
           
 String getPath()
           
 Field.Store getStore()
           
 String getTypePath()
           
 void setAnalyzerClass(Class<? extends Analyzer> alanyzerClass)
           
 void setBoost(float boost)
           
 void setContentType(IndexSchemaField.ContentType type)
           
 void setFieldClass(Class<? extends ContentStrategy> fieldClass)
          Sets the class or strategy is used to extract this field Attention: this method set the contentTyp to IndexSchemaField.ContentType.CUSTOM
 void setIndex(Field.Index index)
           
 void setIndexByName(String name)
          Sets the Index class by simple name
 void setName(String name)
           
 void setPath(String path)
           
 void setStore(Field.Store store)
           
 void setStoreByName(String name)
          Sets the Store class by simple name
 void setType(String type)
          Sets the content type of this field by the name of the enum type.
 void setTypePath(String typePath)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_STORE_STRATEGY

public static final Field.Store DEFAULT_STORE_STRATEGY
Default value for Field.Store

See Also:
Field

DEFAULT_INDEX_STRATEGY

public static final Field.Index DEFAULT_INDEX_STRATEGY
Default value for Field.Index

See Also:
Field
Constructor Detail

IndexSchemaField

public IndexSchemaField()
Constructs a new SchemaField
Default values:
  1. boost: 1.0
  2. index: TOKENIZED
  3. store: NO

Method Detail

getAnalyzerClass

public Class<? extends Analyzer> getAnalyzerClass()
Returns:
Returns the alanyzerClass.

setAnalyzerClass

public void setAnalyzerClass(Class<? extends Analyzer> alanyzerClass)
Parameters:
alanyzerClass - The alanyzerClass to set.

getFieldClass

public Class<? extends ContentStrategy> getFieldClass()
Returns:
Returns the fieldClass.

setFieldClass

public void setFieldClass(Class<? extends ContentStrategy> fieldClass)
Sets the class or strategy is used to extract this field Attention: this method set the contentTyp to IndexSchemaField.ContentType.CUSTOM

Parameters:
fieldClass - The fieldClass to set.

getIndex

public Field.Index getIndex()
Returns:
Returns the index.

setIndex

public void setIndex(Field.Index index)
Parameters:
index - The index to set.

getName

public String getName()
Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.

getPath

public String getPath()
Returns:
Returns the path.

setPath

public void setPath(String path)
Parameters:
path - The path to set.

getStore

public Field.Store getStore()
Returns:
Returns the store.

setStore

public void setStore(Field.Store store)
Parameters:
store - The store to set.

getContentType

public IndexSchemaField.ContentType getContentType()
Returns:
Returns the type.

setContentType

public void setContentType(IndexSchemaField.ContentType type)
Parameters:
type - The type to set.

setType

public void setType(String type)
Sets the content type of this field by the name of the enum type. This method is not case sensitive.

Parameters:
type - - type name as string

getBoost

public float getBoost()
Returns:
Returns the boost.

setBoost

public void setBoost(float boost)
Parameters:
boost - The boost to set.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

setStoreByName

public void setStoreByName(String name)
Sets the Store class by simple name

Parameters:
name - - one of yes, no, compress

setIndexByName

public void setIndexByName(String name)
Sets the Index class by simple name

Parameters:
name - - un_tokenized, tokenized, no, no_norms

getTypePath

public String getTypePath()
Returns:
Returns the typePath.

setTypePath

public void setTypePath(String typePath)
Parameters:
typePath - The typePath to set.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.