Package com.yahoo.search.query
Class QueryType
java.lang.Object
com.yahoo.search.query.QueryType
Detailed query type deciding how a query string is to be interpreted and processed.
- Author:
- bratseth
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQueryType(Query.Type type, QueryType.Composite composite, QueryType.Tokenization tokenization, QueryType.Syntax syntax) QueryType(Query.Type type, QueryType.Composite composite, QueryType.Tokenization tokenization, QueryType.Syntax syntax, boolean isYqlDefault) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic QueryTypefrom(Query.Type type) static QueryTypeReturns the query type given by this string, or the default type (WEAKAND) if the given type is null.static QueryProfileTypeReturns the composite type terms should be collected as by default.Returns the query syntax used in this query.Returns whether this should use internal tokenization, or delegate this to the linguistics component.getType()Returns the overall type of this.inthashCode()booleanReturns whether this should be taken as the default 'grammar' settings when parsing YQL user queries.setComposite(QueryType.Composite composite) Sets the composite type terms should be collected as by default.setComposite(String composite) Sets the composite value from a string enum value.setSyntax(QueryType.Syntax syntax) Sets the query syntax used in this query.Sets the syntax from a string enum value.setTokenization(QueryType.Tokenization tokenization) Sets whether this should use internal tokenization, or delegate this to the linguistics component.setTokenization(String tokenization) Sets tokenization from a string enum value.setYqlDefault(boolean isYqlDefault) Sets whether this query type should be used as the default 'grammar' settings when parsing YQL user queries.toString()voidvalidate()Throws IllegalArgumentException if the combination of options set in this are ot supported.
-
Field Details
-
COMPOSITE
- See Also:
-
TOKENIZATION
- See Also:
-
SYNTAX
- See Also:
-
IS_YQL_DEFAULT
- See Also:
-
-
Constructor Details
-
QueryType
public QueryType(Query.Type type, QueryType.Composite composite, QueryType.Tokenization tokenization, QueryType.Syntax syntax) -
QueryType
public QueryType(Query.Type type, QueryType.Composite composite, QueryType.Tokenization tokenization, QueryType.Syntax syntax, boolean isYqlDefault)
-
-
Method Details
-
getArgumentType
-
getType
Returns the overall type of this. -
getComposite
Returns the composite type terms should be collected as by default. -
setComposite
Sets the composite type terms should be collected as by default.- Returns:
- this for chaining
-
setComposite
Sets the composite value from a string enum value. If the argument is null this does nothing. -
getTokenization
Returns whether this should use internal tokenization, or delegate this to the linguistics component. -
setTokenization
Sets whether this should use internal tokenization, or delegate this to the linguistics component.- Returns:
- this for chaining
-
setTokenization
Sets tokenization from a string enum value. If the argument is null this does nothing. -
getSyntax
Returns the query syntax used in this query. -
setSyntax
Sets the query syntax used in this query.- Returns:
- this for chaining
-
setSyntax
Sets the syntax from a string enum value. If the argument is null this does nothing. -
isYqlDefault
public boolean isYqlDefault()Returns whether this should be taken as the default 'grammar' settings when parsing YQL user queries. Default is false. -
setYqlDefault
Sets whether this query type should be used as the default 'grammar' settings when parsing YQL user queries.- Returns:
- this for chaining
-
validate
public void validate()Throws IllegalArgumentException if the combination of options set in this are ot supported. -
equals
-
hashCode
public int hashCode() -
toString
-
from
-
from
Returns the query type given by this string, or the default type (WEAKAND) if the given type is null.
-