|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlux.compiler.XPathQuery
public class XPathQuery
Wraps a Lucene Query, with advice as to how to process its results as XPath. For now, simply distinguishes the two cases: whether the results are in fact supposed to be the results of the original XPath evaluation, or if further evaluation is needed.
| Field Summary | |
|---|---|
static int |
BOOLEAN_FALSE
A query is boolean_false if its result type is boolean, and the existence of a single query result indicates a 'false()' value |
static int |
EMPTY
queries that match all documents (have no filter) are empty. |
static int |
EXACT
A query is exact iff its xpath expression returns exactly one value per document, and the generated lucene query returns exactly those documents satisfying the xpath expression. |
static int |
IGNORABLE
If a query a is ignorable, then combine(a,b) = b unless b is also ignorable, in which case combine(a,b) = a|b |
static XPathQuery |
MATCH_ALL
|
static int |
MINIMAL
A query is minimal if it returns all, and only, those documents satisfying the xpath expression. |
static int |
SINGULAR
An expression is singular if it returns a single result for every matching document. |
| Constructor Summary | |
|---|---|
protected |
XPathQuery(ParseableQuery query,
long resultFacts,
ValueType valueType)
|
protected |
XPathQuery(ParseableQuery query,
long resultFacts,
ValueType valueType,
boolean immutable)
|
| Method Summary | |
|---|---|
XPathQuery |
combineBooleanQueries(org.apache.lucene.search.BooleanClause.Occur occur,
XPathQuery precursor,
org.apache.lucene.search.BooleanClause.Occur precursorOccur,
ValueType type,
IndexConfiguration config)
Combines this query with another. |
XPathQuery |
combineSpanQueries(XPathQuery precursor,
org.apache.lucene.search.BooleanClause.Occur occur,
ValueType type,
int distance,
IndexConfiguration config)
Combines this query with another, separated by the given distance. |
XPathQuery |
getBaseQuery()
A query generated by a predicate expression. |
long |
getFacts()
|
static XPathQuery |
getMatchAllQuery(IndexConfiguration indexConfig)
|
ParseableQuery |
getParseableQuery()
|
static XPathQuery |
getQuery(ParseableQuery query,
long resultFacts,
ValueType valueType,
IndexConfiguration indexConfig,
org.apache.lucene.search.SortField[] sortFields)
|
ValueType |
getResultType()
|
org.apache.lucene.search.SortField[] |
getSortFields()
|
boolean |
isEmpty()
|
boolean |
isFact(int fact)
|
boolean |
isImmutable()
|
boolean |
isMinimal()
|
void |
setBaseQuery(XPathQuery baseQuery)
|
XPathQuery |
setFact(int fact,
boolean t)
|
void |
setSortFields(org.apache.lucene.search.SortField[] sortFields)
|
void |
setType(ValueType type)
|
String |
toString()
|
AbstractExpression |
toXmlNode(String defaultField,
IndexConfiguration config)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int EXACT
public static final int MINIMAL
public static final int SINGULAR
public static final int BOOLEAN_FALSE
public static final int IGNORABLE
public static final int EMPTY
public static final XPathQuery MATCH_ALL
| Constructor Detail |
|---|
protected XPathQuery(ParseableQuery query,
long resultFacts,
ValueType valueType,
boolean immutable)
query - a Lucene queryresultFacts - a bitmask with interesting facts about this queryvalueType - the type of results returned by the xpath expression, as specifically asimmutable - whether this query may be changed - set true for some internal statics like MATCH_ALL
can be determined.
protected XPathQuery(ParseableQuery query,
long resultFacts,
ValueType valueType)
| Method Detail |
|---|
public org.apache.lucene.search.SortField[] getSortFields()
public void setSortFields(org.apache.lucene.search.SortField[] sortFields)
public static XPathQuery getQuery(ParseableQuery query,
long resultFacts,
ValueType valueType,
IndexConfiguration indexConfig,
org.apache.lucene.search.SortField[] sortFields)
query - the query on which the result is basedresultFacts - the facts to use in the new queryvalueType - the result type of the new queryindexConfig - the indexer configuration; controls which type of match-all query may be returnedsortFields - the sort fields to record in the query
public static XPathQuery getMatchAllQuery(IndexConfiguration indexConfig)
public ParseableQuery getParseableQuery()
public boolean isMinimal()
public ValueType getResultType()
public XPathQuery combineBooleanQueries(org.apache.lucene.search.BooleanClause.Occur occur,
XPathQuery precursor,
org.apache.lucene.search.BooleanClause.Occur precursorOccur,
ValueType type,
IndexConfiguration config)
occur - the occurrence specifier for this queryprecursor - the other queryprecursorOccur - the occurrence specifier for the precursor querytype - the return type of the combined queryconfig - the index configuration
public XPathQuery combineSpanQueries(XPathQuery precursor,
org.apache.lucene.search.BooleanClause.Occur occur,
ValueType type,
int distance,
IndexConfiguration config)
precursor - the other queryoccur - the boolean operator used to combinetype - the return type of the combined querydistance - the distance between the queriesconfig - the index configuration
public boolean isEmpty()
public String toString()
toString in class Object
public XPathQuery setFact(int fact,
boolean t)
public final boolean isFact(int fact)
public long getFacts()
public void setType(ValueType type)
public boolean isImmutable()
public AbstractExpression toXmlNode(String defaultField,
IndexConfiguration config)
public XPathQuery getBaseQuery()
public void setBaseQuery(XPathQuery baseQuery)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||