|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.search.Query
de.pangaea.metadataportal.search.FieldCheckingQuery
public final class FieldCheckingQuery
Low-level implementation of a Lucene Query that is needed by SearchService.newTextQuery(java.lang.String, java.lang.String, org.apache.lucene.queryParser.QueryParser.Operator) to
parse query strings that are specific to one field. When a query string is assigned to a specific
field, the user should not be allowed to use prefixes to reference other field names in his query string.
SearchService wraps the parsed query string with this "filter". In the rewrite(org.apache.lucene.index.IndexReader) method
(when query is expanded to native queries) it checks for terms with foreign field names and throws an exception
if one was found.
| Constructor Summary | |
|---|---|
FieldCheckingQuery(String field,
org.apache.lucene.search.Query query)
Constructor that wraps a query with a check for a specific field name. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
float |
getBoost()
Delegated to wrapped Query |
org.apache.lucene.search.Query |
getQuery()
Returns the wrapped query. |
int |
hashCode()
|
org.apache.lucene.search.Query |
rewrite(org.apache.lucene.index.IndexReader reader)
Expands query to native queries by calling the rewrite-method of the wrapped query. |
void |
setBoost(float b)
Sets the boost for this query clause to b. |
String |
toString(String field)
|
| Methods inherited from class org.apache.lucene.search.Query |
|---|
clone, combine, createWeight, extractTerms, getSimilarity, mergeBooleanQueries, toString, weight |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FieldCheckingQuery(String field,
org.apache.lucene.search.Query query)
| Method Detail |
|---|
public org.apache.lucene.search.Query getQuery()
public String toString(String field)
toString in class org.apache.lucene.search.Querypublic final boolean equals(Object o)
equals in class org.apache.lucene.search.Querypublic final int hashCode()
hashCode in class org.apache.lucene.search.Query
public org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader)
throws IOException
rewrite-method of the wrapped query.
After that it extracts all terms in the query and checks the used field names.
rewrite in class org.apache.lucene.search.QueryIllegalArgumentException - if an invalid field name was detected.
IOExceptionpublic void setBoost(float b)
b. Delegated to wrapped Query.
setBoost in class org.apache.lucene.search.Querypublic float getBoost()
Query
getBoost in class org.apache.lucene.search.Query
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||