org.activemath.omdocjdom.index.queries
Class AbstractAMIndexQuery

java.lang.Object
  extended by org.activemath.omdocjdom.index.queries.AbstractAMIndexQuery
All Implemented Interfaces:
IndexConstants
Direct Known Subclasses:
AMIndexQueryList, IdAMIndexQuery, ItemTypeQuery, MDAttributeAMIndexQuery, PhraseAMIndexQuery, PlainTextAMIndexQuery

public abstract class AbstractAMIndexQuery
extends Object
implements IndexConstants


Field Summary
protected static boolean DEBUG
           
protected static org.apache.commons.logging.Log log
           
 
Fields inherited from interface org.activemath.omdocjdom.index.IndexConstants
FIELDNAME_id, FIELDNAME_metadata, FIELDNAME_type, LANG_ALL, LANG_UNIVERSAL, SUBFIELDNAME_field, SUBFIELDNAME_learningContext
 
Constructor Summary
AbstractAMIndexQuery(List languages)
           
 
Method Summary
 org.apache.lucene.search.Query asLuceneQuery()
           
protected abstract  org.apache.lucene.search.Query createQueryForVariation(String field, String lang)
          Creates a query for this field and language.
 void feedVariationAlongLanguages(float startBoost, org.apache.lucene.search.BooleanQuery bQ, org.apache.lucene.search.BooleanClause.Occur occurenceReq)
          Calls createQueryForVariation(String, String) for each field and language where a text can occur decreasing progessively the boosting.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

DEBUG

protected static final boolean DEBUG
Constructor Detail

AbstractAMIndexQuery

public AbstractAMIndexQuery(List languages)
Method Detail

asLuceneQuery

public org.apache.lucene.search.Query asLuceneQuery()

feedVariationAlongLanguages

public void feedVariationAlongLanguages(float startBoost,
                                        org.apache.lucene.search.BooleanQuery bQ,
                                        org.apache.lucene.search.BooleanClause.Occur occurenceReq)
Calls createQueryForVariation(String, String) for each field and language where a text can occur decreasing progessively the boosting. The first round is the list of titles, successively in each language, the second orund is the list of texts, successively in each language.

Parameters:
startBoost - the first boost factor, that for the match for the title in the first language, that will decrease progressively
bQ - the query to be fed with the variations
occurenceReq - the requirement to occur

createQueryForVariation

protected abstract org.apache.lucene.search.Query createQueryForVariation(String field,
                                                                          String lang)
Creates a query for this field and language.

Parameters:
field - the field name this should apply to
lang - the language (added to the field name if non-null)
Returns:
the query that will be composed with others with varying fields and languages

toString

public String toString()
Overrides:
toString in class Object