fr.gouv.culture.sdx.search.lucene
Class FieldsDefinition

java.lang.Object
  extended byfr.gouv.culture.sdx.search.lucene.FieldsDefinition
All Implemented Interfaces:
java.lang.Cloneable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled

public class FieldsDefinition
extends java.lang.Object
implements org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.configuration.Configurable, java.lang.Cloneable

Definition of fields for a document base.


Constructor Summary
FieldsDefinition()
          This object is used for indexing; it contains a list of fields for a DocumentBase object and contains defaults for fields that do not specify indexing information.
 
Method Summary
 void add(Field field)
          Adds a field to the list
 void addInternalFields(org.apache.avalon.framework.configuration.Configuration conf)
          Adds the internal fields defined in sdx.xconf to the list to allow searching using these fields
 java.lang.Object clone()
          Returns a clone of this FieldsDef.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Sets the configuration options for the field definition.
 void configureFields(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Sets the logger.
 Analyzer getAnalyzer()
          Provides access to the analyzer for the field definition.
 Field getDefaultField()
          Returns the default search field.
 Field getField(java.lang.String name)
          Returns a field given a field name.
 java.util.Enumeration getFields()
          Returns all fields in the FieldsDefinition
 int getFieldType(java.lang.String name)
          Returns the field type.
 java.lang.String getId()
           
 java.util.Locale getLocale()
          Provides access to the locale for the field definition.
 java.util.Locale getLocale(java.lang.String name)
          Returns a locale for a given field.
 org.apache.lucene.document.Field getLuceneField(Property prop)
          Gets a Lucene field from a property.
 void setId(java.lang.String id)
           
 void setProperties(java.util.Hashtable props)
          Sets the properties object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldsDefinition

public FieldsDefinition()

This object is used for indexing; it contains a list of fields for a DocumentBase object and contains defaults for fields that do not specify indexing information.

Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the logger.

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Parameters:
logger - The logger to use.

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Sets the configuration options for the field definition.

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Parameters:
configuration - The configuration object from which to build the field definition.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

configureFields

public void configureFields(org.apache.avalon.framework.configuration.Configuration configuration)
                     throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

addInternalFields

public void addInternalFields(org.apache.avalon.framework.configuration.Configuration conf)
                       throws SDXException,
                              org.apache.avalon.framework.configuration.ConfigurationException
Adds the internal fields defined in sdx.xconf to the list to allow searching using these fields

Parameters:
conf - The configuration object containing the list of internal fields
Throws:
SDXException
org.apache.avalon.framework.configuration.ConfigurationException

getAnalyzer

public Analyzer getAnalyzer()
Provides access to the analyzer for the field definition.

Returns:
The analyzer for the field definition.

getDefaultField

public Field getDefaultField()
Returns the default search field.


getFieldType

public int getFieldType(java.lang.String name)
Returns the field type.

Parameters:
name - The name of the field.

add

public void add(Field field)
         throws SDXException
Adds a field to the list

Parameters:
field - The field to add.
Throws:
SDXException

getLuceneField

public org.apache.lucene.document.Field getLuceneField(Property prop)
                                                throws SDXException
Gets a Lucene field from a property.

Parameters:
prop - The property from which the field will be dervived
Throws:
SDXException

getField

public Field getField(java.lang.String name)
Returns a field given a field name.

Parameters:
name - The field name

getLocale

public java.util.Locale getLocale(java.lang.String name)
Returns a locale for a given field.


getLocale

public java.util.Locale getLocale()
Provides access to the locale for the field definition.


setProperties

public void setProperties(java.util.Hashtable props)
Sets the properties object.

Parameters:
props - The properties object

getFields

public java.util.Enumeration getFields()
Returns all fields in the FieldsDefinition


getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

clone

public java.lang.Object clone()
Returns a clone of this FieldsDef.



Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.