fr.gouv.culture.sdx.thesaurus
Class LuceneQueryExpander

java.lang.Object
  extended by fr.gouv.culture.sdx.utils.AbstractSdxObject
      extended by fr.gouv.culture.sdx.thesaurus.LuceneQueryExpander
All Implemented Interfaces:
Describable, Encodable, Identifiable, Localizable, SdxObject, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.excalibur.xml.sax.XMLizable

public class LuceneQueryExpander
extends AbstractSdxObject


Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject
SdxObject.ConfigurationNode
 
Field Summary
static java.lang.String CLASS_NAME_SUFFIX
           
 
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
 
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable
DEFAULT_ENCODING
 
Constructor Summary
LuceneQueryExpander()
           
 
Method Summary
 org.apache.lucene.search.Query expandQuery(Query query, int[] relations, int depth, java.lang.String[] langs)
           
 org.apache.lucene.search.Query expandQuery(Query query, java.lang.String fieldName, int[] relations, int depth, java.lang.String[] langs)
           
protected  java.lang.String getClassNameSuffix()
          Sub classes should element this method to return their class name suffix for SAX output
protected  boolean initToSax()
          Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML
protected  void initVolatileObjectsToSax()
          Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called
protected  org.apache.lucene.search.Query rebuildQuery(org.apache.lucene.search.Query origQuery, java.lang.String field, int[] relations, int depth, java.lang.String[] langs)
          TODO: this method is too big and dirty.
 void setUp(SDXThesaurus lt)
           
 
Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME_SUFFIX

public static final java.lang.String CLASS_NAME_SUFFIX
See Also:
Constant Field Values
Constructor Detail

LuceneQueryExpander

public LuceneQueryExpander()
Method Detail

setUp

public void setUp(SDXThesaurus lt)

expandQuery

public org.apache.lucene.search.Query expandQuery(Query query,
                                                  int[] relations,
                                                  int depth,
                                                  java.lang.String[] langs)
                                           throws SDXException
Throws:
SDXException

expandQuery

public org.apache.lucene.search.Query expandQuery(Query query,
                                                  java.lang.String fieldName,
                                                  int[] relations,
                                                  int depth,
                                                  java.lang.String[] langs)
                                           throws SDXException
Throws:
SDXException

rebuildQuery

protected org.apache.lucene.search.Query rebuildQuery(org.apache.lucene.search.Query origQuery,
                                                      java.lang.String field,
                                                      int[] relations,
                                                      int depth,
                                                      java.lang.String[] langs)
                                               throws SDXException
TODO: this method is too big and dirty. refactoring points 1) query analysis should be done externally (in another method) i) terms lists should be derived externally and passed in ii) queries should be cloned in a smarter fashion

Parameters:
origQuery -
field -
relations -
depth -
langs -
Throws:
SDXException

getClassNameSuffix

protected java.lang.String getClassNameSuffix()
Description copied from class: AbstractSdxObject
Sub classes should element this method to return their class name suffix for SAX output

Specified by:
getClassNameSuffix in class AbstractSdxObject

initToSax

protected boolean initToSax()
Description copied from class: AbstractSdxObject
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML

Specified by:
initToSax in class AbstractSdxObject

initVolatileObjectsToSax

protected void initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called

Specified by:
initVolatileObjectsToSax in class AbstractSdxObject


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