|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.gouv.culture.sdx.utils.lucene.LuceneTools
public class LuceneTools
Contains miscellaneous utility methods for use with Lucene.
Constructor Summary | |
---|---|
protected |
LuceneTools()
LuceneTools must not be instantiated directly. |
Method Summary | |
---|---|
static java.lang.String |
getFieldNameFromKey(java.lang.String key)
|
static void |
getTerms(org.apache.lucene.search.Query query,
java.util.Hashtable terms,
boolean prohibited)
Extracts all term texts of a given Query. |
protected static void |
getTermsFromBooleanQuery(org.apache.lucene.search.BooleanQuery query,
java.util.Hashtable terms,
boolean prohibited)
Extracts all term texts of a given BooleanQuery. |
protected static void |
getTermsFromPhraseQuery(org.apache.lucene.search.PhraseQuery query,
java.util.Hashtable terms)
Extracts all term texts of a given PhraseQuery. |
protected static void |
getTermsFromTerm(org.apache.lucene.index.Term term,
java.util.Hashtable terms)
Extracts the term of a given Term. |
protected static void |
getTermsFromTermQuery(org.apache.lucene.search.TermQuery query,
java.util.Hashtable terms)
Extracts all term texts of a given TermQuery. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LuceneTools()
Method Detail |
---|
public static final void getTerms(org.apache.lucene.search.Query query, java.util.Hashtable terms, boolean prohibited) throws java.io.IOException
query
- Query to extract term texts fromterms
- HashTable where extracted term texts should be put into (see below for Hashtable storage format)prohibited
- true
to extract "prohibited" terms, too
Terms texts will be stored as values in the provided hashtable with the keys in the format
fieldName_termText as multiple terms can come from one field and multiple fields can have the same term
java.io.IOException
A utility method for getting a field name from a key of the hashtable for a value/term text
protected static final void getTermsFromBooleanQuery(org.apache.lucene.search.BooleanQuery query, java.util.Hashtable terms, boolean prohibited) throws java.io.IOException
query
- BooleanQuery to extract term texts fromterms
- HashSet where extracted term texts should be put into (Elements: String)prohibited
- true
to extract "prohibited" terms, too
java.io.IOException
protected static final void getTermsFromPhraseQuery(org.apache.lucene.search.PhraseQuery query, java.util.Hashtable terms)
query
- PhraseQuery to extract term texts fromterms
- HashSet where extracted term texts should be put into (Elements: String)protected static final void getTermsFromTermQuery(org.apache.lucene.search.TermQuery query, java.util.Hashtable terms)
query
- TermQuery to extract term texts fromterms
- HashSet where extracted term texts should be put into (Elements: String)protected static void getTermsFromTerm(org.apache.lucene.index.Term term, java.util.Hashtable terms)
term
- Term to extract term fromterms
- The hashtable to which the term information should be added, ie the field name and text for the term
TODO: is it here we have to control the field to decode a date ? [MP]public static java.lang.String getFieldNameFromKey(java.lang.String key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |