QueryType Class

public final class QueryType
extends ExpandableStringEnum<QueryType>

Specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax and 'semantic' if query syntax is not needed.

Field Summary

Modifier and Type Field and Description
static final QueryType FULL

Uses the full Lucene query syntax for searches.

static final QueryType SEMANTIC

Best suited for queries expressed in natural language as opposed to keywords.

static final QueryType SIMPLE

Uses the simple query syntax for searches.

Constructor Summary

Constructor Description
QueryType()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of QueryType value.

Method Summary

Modifier and Type Method and Description
static QueryType fromString(String name)

Creates or finds a QueryType from its string representation.

static Collection<QueryType> values()

Gets known QueryType values.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

FULL

public static final QueryType FULL

Uses the full Lucene query syntax for searches. Search text is interpreted using the Lucene query language which allows field-specific and weighted searches, as well as other advanced features.

SEMANTIC

public static final QueryType SEMANTIC

Best suited for queries expressed in natural language as opposed to keywords. Improves precision of search results by re-ranking the top search results using a ranking model trained on the Web corpus.

SIMPLE

public static final QueryType SIMPLE

Uses the simple query syntax for searches. Search text is interpreted using a simple query language that allows for symbols such as +, * and "". Queries are evaluated across all searchable fields by default, unless the searchFields parameter is specified.

Constructor Details

QueryType

@Deprecated
public QueryType()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of QueryType value.

Method Details

fromString

public static QueryType fromString(String name)

Creates or finds a QueryType from its string representation.

Parameters:

name - a name to look for.

Returns:

the corresponding QueryType.

values

public static Collection<QueryType> values()

Gets known QueryType values.

Returns:

known QueryType values.

Applies to