Package org.ametys.cms.search.query
Class FullTextQuery
- java.lang.Object
-
- org.ametys.cms.search.query.FullTextQuery
-
- All Implemented Interfaces:
Query
public class FullTextQuery extends Object implements Query
AQueryrealizing a full-text search on contents (search on all properties). Available operators:- SEARCH (default)
- SEARCH_STEMMED
- LIKE
- EQ
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator
-
-
Field Summary
Fields Modifier and Type Field Description protected String_languageThe language.protected Query.Operator_operatorThe operator.protected String_valueThe value to test.protected boolean_valueAlreadyEscapedtrueif the value is already escaped and there is no need to escape again the value duringthe build of the query.
-
Constructor Summary
Constructors Constructor Description FullTextQuery(String value)Build a FullTextQuery.FullTextQuery(String value, String language)Build a FullTextQuery.FullTextQuery(String value, String language, Query.Operator operator)Build a FullTextQuery.FullTextQuery(String value, String language, Query.Operator operator, boolean alreadyEscaped)Build a FullTextQuery.FullTextQuery(String value, Query.Operator operator)Build a FullTextQuery.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Build the solr query string representing the Query object.booleanequals(Object obj)StringgetLanguage()Get the language.Query.OperatorgetOperator()Get the operator to use.StringgetValue()Get the value.inthashCode()
-
-
-
Field Detail
-
_operator
protected Query.Operator _operator
The operator.
-
_valueAlreadyEscaped
protected boolean _valueAlreadyEscaped
trueif the value is already escaped and there is no need to escape again the value duringthe build of the query.
-
-
Constructor Detail
-
FullTextQuery
public FullTextQuery(String value)
Build a FullTextQuery.- Parameters:
value- the value.
-
FullTextQuery
public FullTextQuery(String value, Query.Operator operator)
Build a FullTextQuery.- Parameters:
value- the value.operator- The operator to use.
-
FullTextQuery
public FullTextQuery(String value, String language)
Build a FullTextQuery.- Parameters:
value- the value.language- the language.
-
FullTextQuery
public FullTextQuery(String value, String language, Query.Operator operator)
Build a FullTextQuery.- Parameters:
value- the value.language- the language.operator- The operator to use.
-
FullTextQuery
public FullTextQuery(String value, String language, Query.Operator operator, boolean alreadyEscaped)
Build a FullTextQuery.- Parameters:
value- the value.language- the language.operator- The operator to use.alreadyEscaped- true if the value is already escaped and there is no need to escape again the value duringthe build of the query.
-
-
Method Detail
-
getLanguage
public String getLanguage()
Get the language.- Returns:
- the language.
-
getOperator
public Query.Operator getOperator()
Get the operator to use.- Returns:
- the operator.
-
build
public String build() throws QuerySyntaxException
Description copied from interface:QueryBuild the solr query string representing the Query object.- Specified by:
buildin interfaceQuery- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException- if the query can't be built because of a syntax error.
-
-