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
AQuery
realizing 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
_language
The language.protected Query.Operator
_operator
The operator.protected String
_value
The value to test.protected boolean
_valueAlreadyEscaped
true
if 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 String
build()
Build the solr query string representing the Query object.boolean
equals(Object obj)
String
getLanguage()
Get the language.Query.Operator
getOperator()
Get the operator to use.String
getValue()
Get the value.int
hashCode()
-
-
-
Field Detail
-
_operator
protected Query.Operator _operator
The operator.
-
_valueAlreadyEscaped
protected boolean _valueAlreadyEscaped
true
if 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:Query
Build the solr query string representing the Query object.- Specified by:
build
in interfaceQuery
- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException
- if the query can't be built because of a syntax error.
-
-