public class XPathQuery extends Object
| Modifier and Type | Field and Description |
|---|---|
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 |
PATH_COMBINED
queries whose path query constraint is already incorporated into the main query
|
static int |
SINGULAR
An expression is singular if it returns a single result for every matching document.
|
| Modifier | Constructor and Description |
|---|---|
protected |
XPathQuery(ParseableQuery query,
long resultFacts,
ValueType valueType) |
protected |
XPathQuery(ParseableQuery query,
long resultFacts,
ValueType valueType,
boolean immutable) |
protected |
XPathQuery(ParseableQuery query,
ParseableQuery pathQuery,
long resultFacts,
ValueType valueType,
boolean immutable) |
| Modifier and Type | Method and Description |
|---|---|
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,
boolean isPredicate,
ValueType type,
int distance,
IndexConfiguration config)
Combines this query with another, separated by the given distance.
|
ParseableQuery |
getBooleanQuery() |
long |
getFacts() |
ParseableQuery |
getFullQuery() |
static XPathQuery |
getMatchAllQuery(IndexConfiguration indexConfig) |
ParseableQuery |
getPathQuery()
A query generated by a predicate expression.
|
static XPathQuery |
getQuery(ParseableQuery termQuery,
long facts,
ValueType type,
IndexConfiguration indexConfig,
org.apache.lucene.search.SortField[] sortFields) |
static XPathQuery |
getQuery(ParseableQuery query,
ParseableQuery pathQuery,
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() |
XPathQuery |
setFact(int fact,
boolean t) |
void |
setPathQuery(ParseableQuery baseQuery) |
void |
setSortFields(org.apache.lucene.search.SortField[] sortFields) |
XPathQuery |
setType(ValueType type) |
String |
toString() |
AbstractExpression |
toXmlNode(String defaultField,
IndexConfiguration config) |
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 int PATH_COMBINED
public static final XPathQuery MATCH_ALL
protected XPathQuery(ParseableQuery query, ParseableQuery pathQuery, long resultFacts, ValueType valueType, boolean immutable)
query - a Lucene querypathQuery - a Lucene query representing a constraint that the context item's path existsresultFacts - 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, boolean immutable)
protected XPathQuery(ParseableQuery query, long resultFacts, ValueType valueType)
public org.apache.lucene.search.SortField[] getSortFields()
public void setSortFields(org.apache.lucene.search.SortField[] sortFields)
public static XPathQuery getQuery(ParseableQuery query, ParseableQuery pathQuery, long resultFacts, ValueType valueType, IndexConfiguration indexConfig, org.apache.lucene.search.SortField[] sortFields)
query - the query on which the result is basedpathQuery - resultFacts - 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 querypublic static XPathQuery getQuery(ParseableQuery termQuery, long facts, ValueType type, IndexConfiguration indexConfig, org.apache.lucene.search.SortField[] sortFields)
public static XPathQuery getMatchAllQuery(IndexConfiguration indexConfig)
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 configurationpublic XPathQuery combineSpanQueries(XPathQuery precursor, org.apache.lucene.search.BooleanClause.Occur occur, boolean isPredicate, ValueType type, int distance, IndexConfiguration config)
precursor - the other queryoccur - the boolean operator used to combineisPredicate - whether the enclosing expression is a predicate (or a path expression)type - the return type of the combined querydistance - the distance between the queriesconfig - the index configurationpublic boolean isEmpty()
public XPathQuery setFact(int fact, boolean t)
public final boolean isFact(int fact)
public long getFacts()
public XPathQuery setType(ValueType type)
public boolean isImmutable()
public AbstractExpression toXmlNode(String defaultField, IndexConfiguration config)
public ParseableQuery getBooleanQuery()
public ParseableQuery getPathQuery()
public void setPathQuery(ParseableQuery baseQuery)
public ParseableQuery getFullQuery()
Copyright © 2013. All Rights Reserved.