public class QueryOptions
extends com.ibm.cloud.sdk.core.service.model.GenericModel
Modifier and Type | Class and Description |
---|---|
static class |
QueryOptions.Builder
Builder.
|
Modifier and Type | Method and Description |
---|---|
String |
aggregation()
Gets the aggregation.
|
List<String> |
collectionIds()
Gets the collectionIds.
|
Long |
count()
Gets the count.
|
String |
filter()
Gets the filter.
|
Boolean |
highlight()
Gets the highlight.
|
String |
naturalLanguageQuery()
Gets the naturalLanguageQuery.
|
QueryOptions.Builder |
newBuilder()
New builder.
|
Long |
offset()
Gets the offset.
|
QueryLargePassages |
passages()
Gets the passages.
|
String |
projectId()
Gets the projectId.
|
String |
query()
Gets the query.
|
QueryLargeSimilar |
similar()
Gets the similar.
|
String |
sort()
Gets the sort.
|
Boolean |
spellingSuggestions()
Gets the spellingSuggestions.
|
QueryLargeSuggestedRefinements |
suggestedRefinements()
Gets the suggestedRefinements.
|
QueryLargeTableResults |
tableResults()
Gets the tableResults.
|
List<String> |
xReturn()
Gets the xReturn.
|
public QueryOptions.Builder newBuilder()
public String projectId()
The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery.
public List<String> collectionIds()
A comma-separated list of collection IDs to be queried against.
public String filter()
Searches for documents that match the Discovery Query Language criteria that is specified as input. Filter calls are cached and are faster than query calls because the results are not ordered by relevance. When used with the **aggregation**, **query**, or **natural_language_query** parameters, the **filter** parameter runs first. This parameter is useful for limiting results to those that contain specific metadata values.
public String query()
A query search that is written in the Discovery Query Language and returns all matching documents in your data set with full enrichments and full text, and with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
public String naturalLanguageQuery()
A natural language query that returns relevant documents by using training data and natural language understanding.
public String aggregation()
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For more information about the supported types of aggregations, see the [Discovery documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregations).
public Long count()
Number of results to return.
public List<String> xReturn()
A list of the fields in the document hierarchy to return. You can specify both root-level (`text`) and nested (`extracted_metadata.filename`) fields. If this parameter is an empty list, then all fields are returned.
public Long offset()
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
public String sort()
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending is the default sort direction if no prefix is specified.
public Boolean highlight()
When `true`, a highlight field is returned for each result that contains fields that match the query. The matching query terms are emphasized with surrounding `<em></em>` tags. This parameter is ignored if **passages.enabled** and **passages.per_document** are `true`, in which case passages are returned for each document instead of highlights.
public Boolean spellingSuggestions()
When `true` and the **natural_language_query** parameter is used, the **natural_language_query** parameter is spell checked. The most likely correction is returned in the **suggested_query** field of the response (if one exists).
public QueryLargeTableResults tableResults()
Configuration for table retrieval.
public QueryLargeSuggestedRefinements suggestedRefinements()
Configuration for suggested refinements.
**Note**: The **suggested_refinements** parameter that identified dynamic facets from the data is deprecated.
public QueryLargePassages passages()
Configuration for passage retrieval.
public QueryLargeSimilar similar()
Finds results from documents that are similar to documents of interest. Use this parameter to add a *More like these* function to your search. You can include this parameter with or without a **query**, **filter** or **natural_language_query** parameter.
Copyright © 2022 IBM Cloud. All rights reserved.