|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.impl.DefaultCompassQueryBuilder
public class DefaultCompassQueryBuilder
| Constructor Summary | |
|---|---|
DefaultCompassQueryBuilder(SearchEngineQueryBuilder queryBuilder,
InternalCompassSession session)
|
|
| Method Summary | |
|---|---|
CompassQueryBuilder |
addAliasQueryIfNeeded(boolean addAliasQueryIfNeeded)
Should the query builder wrap automatically any query that has dot path notation (such as alias.property) with specific narrowing to match the given alias. |
CompassQuery |
alias(String aliasValue)
Returns a query that exactly match the given alias. |
CompassQuery |
between(String name,
Object low,
Object high,
boolean inclusive)
Creates a query where the resource property is between the given values. |
CompassQuery |
between(String name,
Object low,
Object high,
boolean inclusive,
boolean constantScore)
Creates a query where the resource property is between the given values. |
CompassQueryBuilder.CompassBooleanQueryBuilder |
bool()
Constructs a boolean query builder. |
CompassQueryBuilder.CompassBooleanQueryBuilder |
bool(boolean disableCoord)
Constructs a boolean query builder, with coord disabled. |
CompassQueryBuilder |
convertOnlyWithDotPath(boolean convertOnlyWithDotPath)
Should Compass use a converter for value passed even if there is no specific direct dot path notation to it. |
CompassQuery |
fuzzy(String name,
String value)
Creates a fuzzy query for the given resource property and the value. |
CompassQuery |
fuzzy(String name,
String value,
float minimumSimilarity)
Creates a fuzzy query for the given resource property and the value. |
CompassQuery |
fuzzy(String name,
String value,
float minimumSimilarity,
int prefixLength)
Creates a fuzzy query for the given resource property and the value. |
CompassQuery |
ge(String name,
Object value)
Creates a query where the resource property is greater or equal (>=) to the given value. |
CompassQuery |
gt(String name,
Object value)
Creates a query where the resource property is greater than (>) to the given value. |
CompassQuery |
le(String name,
Object value)
Creates a query where the resource property is less or equal (<=) to the given value. |
CompassQuery |
lt(String name,
Object value)
Creates a query where the resource property is less than (<) the given value. |
CompassQuery |
matchAll()
Creates a query that match all documents. |
CompassQueryBuilder.CompassMoreLikeThisQuery |
moreLikeThis(Reader reader)
Constructs a more like this query to find hits that are similar to the give text represented by the reader. |
CompassQueryBuilder.CompassMoreLikeThisQuery |
moreLikeThis(String alias,
Serializable id)
Constructs a more like this query. |
CompassQueryBuilder.CompassMultiPhraseQueryBuilder |
multiPhrase(String name)
Constructs a multi phrase query builder for the given resource property / meta-data name. |
CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder |
multiPropertyQueryString(String queryString)
Constructs a multi property query string builder, allowing to execute query strings against several resource property names. |
CompassQuery |
polyAlias(String aliasValue)
Returns a query that match the given alias or any extedning aliases. |
CompassQuery |
prefix(String name,
String prefix)
Creates a query where the resource property values starts with the given prefix. |
CompassQueryBuilder.CompassQueryStringBuilder |
queryString(String queryString)
Constructs a query string query builder. |
CompassQuery.CompassSpanQuery |
spanEq(String name,
Object value)
Creates a span query where the resource property must match the given value. |
CompassQuery.CompassSpanQuery |
spanFirst(CompassQuery.CompassSpanQuery spanQuery,
int end)
Creates a span query. |
CompassQuery.CompassSpanQuery |
spanFirst(String name,
Object value,
int end)
Creates a span query where the span occur within the first end positions. |
CompassQueryBuilder.CompassQuerySpanNearBuilder |
spanNear(String name)
Constructs a span near query builder. |
CompassQuery.CompassSpanQuery |
spanNot(CompassQuery.CompassSpanQuery include,
CompassQuery.CompassSpanQuery exclude)
Creates a span query that excludes matches where one CompassQuery.CompassSpanQuery overlaps
with another. |
CompassQueryBuilder.CompassQuerySpanOrBuilder |
spanOr()
Constructs a span or query builder. |
CompassQuery |
term(String name,
Object value)
Creates a query where the resource property must have the given value. |
CompassQuery |
wildcard(String name,
String wildcard)
Creates a query where the resource property values match the given wildcard. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultCompassQueryBuilder(SearchEngineQueryBuilder queryBuilder,
InternalCompassSession session)
| Method Detail |
|---|
public CompassQueryBuilder convertOnlyWithDotPath(boolean convertOnlyWithDotPath)
CompassQueryBuilderfalse.
convertOnlyWithDotPath in interface CompassQueryBuilderResourcePropertyLookup.setConvertOnlyWithDotPath(boolean)public CompassQueryBuilder addAliasQueryIfNeeded(boolean addAliasQueryIfNeeded)
CompassQueryBuilderalias.property) with specific narrowing to match the given alias. Default to
true.
addAliasQueryIfNeeded in interface CompassQueryBuilderpublic CompassQueryBuilder.CompassBooleanQueryBuilder bool()
CompassQueryBuilder
bool in interface CompassQueryBuilderpublic CompassQueryBuilder.CompassBooleanQueryBuilder bool(boolean disableCoord)
CompassQueryBuilder
bool in interface CompassQueryBuilderpublic CompassQueryBuilder.CompassMultiPhraseQueryBuilder multiPhrase(String name)
CompassQueryBuilder
multiPhrase in interface CompassQueryBuildername - The name of the resource property / meta-data.
public CompassQueryBuilder.CompassQueryStringBuilder queryString(String queryString)
CompassQueryBuilder
queryString in interface CompassQueryBuilderqueryString - The query string (i.e. +jack +london).
public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder multiPropertyQueryString(String queryString)
CompassQueryBuilder
multiPropertyQueryString in interface CompassQueryBuilderqueryString - The query string (i.e. +jack +london)
public CompassQuery alias(String aliasValue)
CompassQueryBuilderNote, this will not narrow down the search to specific sub indxes.
In order to do that, please use CompassQuery.setAliases(String[]).
alias in interface CompassQueryBuilderaliasValue - The alias value to match to.
public CompassQuery polyAlias(String aliasValue)
CompassQueryBuilderNote, this will not narrow down the search to specific sub indxes.
In order to do that, please use CompassQuery.setAliases(String[]).
polyAlias in interface CompassQueryBuilderaliasValue - The alias value to match to or any extending aliases.
public CompassQuery term(String name,
Object value)
CompassQueryBuilderCreates a query where the resource property must have the given value.
Note, that the value itself will not be analyzed, but the text that was
indexed might have been (if indexed). The search is case
sensative.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
term in interface CompassQueryBuildername - The resource property namevalue - The value that must match
public CompassQuery matchAll()
CompassQueryBuilder
matchAll in interface CompassQueryBuilder
public CompassQuery between(String name,
Object low,
Object high,
boolean inclusive,
boolean constantScore)
CompassQueryBuilderCreates a query where the resource property is between the given values.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
between in interface CompassQueryBuildername - The resource property namelow - The low value limithigh - The high value limitinclusive - If the values are inclusive or exclusive.constantScore - If the query will affect the score of the results. With all other range queries
it will default to true.
public CompassQuery between(String name,
Object low,
Object high,
boolean inclusive)
CompassQueryBuilderCreates a query where the resource property is between the given values.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
between in interface CompassQueryBuildername - The resource property namelow - The low value limithigh - The high value limitinclusive - If the values are inclusive or exclusive.
public CompassQuery lt(String name,
Object value)
CompassQueryBuilderCreates a query where the resource property is less than (<) the given value.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
lt in interface CompassQueryBuildername - The resource property namevalue - The high limit value
public CompassQuery le(String name,
Object value)
CompassQueryBuilderCreates a query where the resource property is less or equal (<=) to the given value.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
le in interface CompassQueryBuildername - The resource property namevalue - The high limit value
public CompassQuery gt(String name,
Object value)
CompassQueryBuilderCreates a query where the resource property is greater than (>) to the given value.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
gt in interface CompassQueryBuildername - The resource property namevalue - The low limit value
public CompassQuery ge(String name,
Object value)
CompassQueryBuilderCreates a query where the resource property is greater or equal (>=) to the given value.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
ge in interface CompassQueryBuildername - The resource property namevalue - The low limit value
public CompassQuery prefix(String name,
String prefix)
CompassQueryBuilderCreates a query where the resource property values starts with the given prefix.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
prefix in interface CompassQueryBuildername - the resource property nameprefix - The prefix value
public CompassQuery wildcard(String name,
String wildcard)
CompassQueryBuilder*, which matches any
character sequence (including the empty one), and ?,
which matches any single character. Note this query can be slow, as it
needs to iterate over many terms. In order to prevent extremely slow
WildcardQueries, a Wildcard term should not start with one of the
wildcards * or ?.
wildcard in interface CompassQueryBuildername - The namewildcard - The wildcard expression
public CompassQuery fuzzy(String name,
String value,
float minimumSimilarity)
CompassQueryBuilderCreates a fuzzy query for the given resource property and the value. The similiarity measurement is based on the Levenshtein (edit distance) algorithm. The prefixLength defaults to 0.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
fuzzy in interface CompassQueryBuildername - The namevalue - The valueminimumSimilarity - The minimum similarity, a value between 0.0 and 1.0
public CompassQuery fuzzy(String name,
String value,
float minimumSimilarity,
int prefixLength)
CompassQueryBuilderCreates a fuzzy query for the given resource property and the value. The similiarity measurement is based on the Levenshtein (edit distance) algorithm.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
fuzzy in interface CompassQueryBuildername - The namevalue - The valueminimumSimilarity - The minimum similarity, a value between 0.0 and 1.0prefixLength - The length of common (non-fuzzy) prefix
public CompassQuery fuzzy(String name,
String value)
CompassQueryBuilderCreates a fuzzy query for the given resource property and the value. The similiarity measurement is based on the Levenshtein (edit distance) algorithm. The minimumSimilarity defaults to 0.5 and prefixLength defaults to 0.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
fuzzy in interface CompassQueryBuildername - The namevalue - The value
public CompassQuery.CompassSpanQuery spanEq(String name,
Object value)
CompassQueryBuilderCreates a span query where the resource property must match the given value.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
spanEq in interface CompassQueryBuildername - The namevalue - The value
public CompassQuery.CompassSpanQuery spanFirst(String name,
Object value,
int end)
CompassQueryBuilderCreates a span query where the span occur within the first
end positions.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
spanFirst in interface CompassQueryBuildername - The namevalue - The valueend - The limit on the position from the start.
public CompassQuery.CompassSpanQuery spanFirst(CompassQuery.CompassSpanQuery spanQuery,
int end)
CompassQueryBuilderCreates a span query.
spanFirst in interface CompassQueryBuilderend - The limit on the position from the start.
public CompassQueryBuilder.CompassQuerySpanNearBuilder spanNear(String name)
CompassQueryBuilderConstructs a span near query builder.
The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
spanNear in interface CompassQueryBuildername - The name
public CompassQuery.CompassSpanQuery spanNot(CompassQuery.CompassSpanQuery include,
CompassQuery.CompassSpanQuery exclude)
CompassQueryBuilderCreates a span query that excludes matches where one
CompassQuery.CompassSpanQuery overlaps
with another.
Construct a span query matching spans from include which
have no overlap with spans from exclude.
spanNot in interface CompassQueryBuilderinclude - The span query to include.exclude - The span query to exclude.
public CompassQueryBuilder.CompassQuerySpanOrBuilder spanOr()
CompassQueryBuilder
spanOr in interface CompassQueryBuilder
public CompassQueryBuilder.CompassMoreLikeThisQuery moreLikeThis(String alias,
Serializable id)
CompassQueryBuilder
moreLikeThis in interface CompassQueryBuilderpublic CompassQueryBuilder.CompassMoreLikeThisQuery moreLikeThis(Reader reader)
CompassQueryBuilder
moreLikeThis in interface CompassQueryBuilder
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||