public class PatternQueryEngine extends QueryEngine
QueryModel
and relates specifically to a search-style query
to find content that matches the desired query pattern and conditions. To be recognised
by the default classes, the root request
element should have the tag entity
of QueryConst.QUERYMODEL
, or 'Query_Model'. This should then contain the
element pattern to match. This pattern can have certain constraints associated
with each element in the pattern. The documentation describes the query structure
in more detail.Modifier and Type | Field and Description |
---|---|
protected static int |
lineIndex
Search marker
|
Constructor and Description |
---|
PatternQueryEngine()
Create a new instance of PatternQueryEngine.
|
Modifier and Type | Method and Description |
---|---|
static java.util.ArrayList<java.lang.String> |
getHashCodes(java.util.ArrayList<java.util.ArrayList<org.licas_xml.abs.Element>> elementList)
Get the list of hash codes that map to elements in the document.
|
static java.util.ArrayList<java.lang.Integer> |
hashCodeIndexes(org.licas_xml.abs.Element doc,
java.util.ArrayList<java.lang.String> matchTo)
Traverse the document and match the hash codes in the matchTo list to it
and stores the matched element indexes.
|
protected java.util.ArrayList<java.util.ArrayList<org.licas_xml.abs.Element>> |
metaSearchXml(org.licas_xml.abs.Element textToSearch,
QueryModel queryModel)
Query the xml-based text to find matching information.
|
allowsCase, allowsWildcards, constraintIsAttribute, constraintNeedsValue, getComparisonOps, getConstraintTypes, getCorrectTextType, getLogicalOps, getReciprocalComparison, getTextTypes, getWildcardCount, isCurrencyChar, isEndConstraint, isNumericalConstraint, isNumericalQueryType, isOtherQueryType, isPatternType, isRangeConstraint, isSearchType, isSingleConstraint, isStartConstraint, isTextQueryType, isWildcard, isWildcard, isXmlQueryType, parseWildcards
public PatternQueryEngine()
protected java.util.ArrayList<java.util.ArrayList<org.licas_xml.abs.Element>> metaSearchXml(org.licas_xml.abs.Element textToSearch, QueryModel queryModel) throws java.lang.Exception
textToSearch
- the xml-based text to search over.queryModel
- the query model.java.lang.Exception
- any error.public static java.util.ArrayList<java.lang.String> getHashCodes(java.util.ArrayList<java.util.ArrayList<org.licas_xml.abs.Element>> elementList)
elementList
- a list of elements.public static java.util.ArrayList<java.lang.Integer> hashCodeIndexes(org.licas_xml.abs.Element doc, java.util.ArrayList<java.lang.String> matchTo) throws java.lang.Exception
doc
- the root element of the main document.matchTo
- a list of element hash codes to match to.java.lang.Exception
- any error.