discoveryv2

package
v0.0.0-...-0deef17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package discoveryv2 : Operations and models for the DiscoveryV2 service

Index

Constants

View Source
const (
	ComponentSettingsAggregation_VisualizationType_Auto       = "auto"
	ComponentSettingsAggregation_VisualizationType_FacetTable = "facet_table"
	ComponentSettingsAggregation_VisualizationType_Map        = "map"
	ComponentSettingsAggregation_VisualizationType_WordCloud  = "word_cloud"
)

Constants associated with the ComponentSettingsAggregation.VisualizationType property. Type of visualization to use when rendering the aggregation.

View Source
const (
	DocumentAccepted_Status_Pending    = "pending"
	DocumentAccepted_Status_Processing = "processing"
)

Constants associated with the DocumentAccepted.Status property. Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others.

View Source
const (
	Field_Type_Binary  = "binary"
	Field_Type_Boolean = "boolean"
	Field_Type_Byte    = "byte"
	Field_Type_Date    = "date"
	Field_Type_Double  = "double"
	Field_Type_Float   = "float"
	Field_Type_Integer = "integer"
	Field_Type_Long    = "long"
	Field_Type_Nested  = "nested"
	Field_Type_Short   = "short"
	Field_Type_String  = "string"
)

Constants associated with the Field.Type property. The type of the field.

View Source
const (
	Notice_Severity_Error   = "error"
	Notice_Severity_Warning = "warning"
)

Constants associated with the Notice.Severity property. Severity level of the notice.

View Source
const (
	QueryResultMetadata_DocumentRetrievalSource_Curation = "curation"
	QueryResultMetadata_DocumentRetrievalSource_Search   = "search"
)

Constants associated with the QueryResultMetadata.DocumentRetrievalSource property. The document retrieval source that produced this search result.

View Source
const (
	RetrievalDetails_DocumentRetrievalStrategy_RelevancyTraining = "relevancy_training"
	RetrievalDetails_DocumentRetrievalStrategy_Untrained         = "untrained"
)

Constants associated with the RetrievalDetails.DocumentRetrievalStrategy property. Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results were returned using a relevancy trained model.

**Note**: In the event of trained collections being queried, but the trained model is not used to return results,

the **document_retrieval_strategy** will be listed as `untrained`.

View Source
const (
	DeleteDocumentResponse_Status_Deleted = "deleted"
)

Constants associated with the DeleteDocumentResponse.Status property. Status of the document. A deleted document has the status deleted.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDocumentOptions

type AddDocumentOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The ID of the collection.
	CollectionID *string `json:"collection_id" validate:"required"`

	// The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50
	// megabytes, the maximum supported file size when testing a confiruration is 1 megabyte. Files larger than the
	// supported size are rejected.
	File io.ReadCloser `json:"file,omitempty"`

	// The filename for file.
	Filename *string `json:"filename,omitempty"`

	// The content type of file.
	FileContentType *string `json:"file_content_type,omitempty"`

	// The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:  “` {
	//   "Creator": "Johnny Appleseed",
	//   "Subject": "Apples"
	// } “`.
	Metadata *string `json:"metadata,omitempty"`

	// When `true`, the uploaded document is added to the collection even if the data for that collection is shared with
	// other collections.
	XWatsonDiscoveryForce *bool `json:"X-Watson-Discovery-Force,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

AddDocumentOptions : The AddDocument options.

func (*AddDocumentOptions) SetCollectionID

func (options *AddDocumentOptions) SetCollectionID(collectionID string) *AddDocumentOptions

SetCollectionID : Allow user to set CollectionID

func (*AddDocumentOptions) SetFile

func (options *AddDocumentOptions) SetFile(file io.ReadCloser) *AddDocumentOptions

SetFile : Allow user to set File

func (*AddDocumentOptions) SetFileContentType

func (options *AddDocumentOptions) SetFileContentType(fileContentType string) *AddDocumentOptions

SetFileContentType : Allow user to set FileContentType

func (*AddDocumentOptions) SetFilename

func (options *AddDocumentOptions) SetFilename(filename string) *AddDocumentOptions

SetFilename : Allow user to set Filename

func (*AddDocumentOptions) SetHeaders

func (options *AddDocumentOptions) SetHeaders(param map[string]string) *AddDocumentOptions

SetHeaders : Allow user to set Headers

func (*AddDocumentOptions) SetMetadata

func (options *AddDocumentOptions) SetMetadata(metadata string) *AddDocumentOptions

SetMetadata : Allow user to set Metadata

func (*AddDocumentOptions) SetProjectID

func (options *AddDocumentOptions) SetProjectID(projectID string) *AddDocumentOptions

SetProjectID : Allow user to set ProjectID

func (*AddDocumentOptions) SetXWatsonDiscoveryForce

func (options *AddDocumentOptions) SetXWatsonDiscoveryForce(xWatsonDiscoveryForce bool) *AddDocumentOptions

SetXWatsonDiscoveryForce : Allow user to set XWatsonDiscoveryForce

type Collection

type Collection struct {

	// The unique identifier of the collection.
	CollectionID *string `json:"collection_id,omitempty"`

	// The name of the collection.
	Name *string `json:"name,omitempty"`
}

Collection : A collection for storing documents.

type Completions

type Completions struct {

	// Array of autcomplete suggestion based on the provided prefix.
	Completions []string `json:"completions,omitempty"`
}

Completions : An object containing an array of autocompletion suggestions.

type ComponentSettingsAggregation

type ComponentSettingsAggregation struct {

	// Identifier used to map aggregation settings to aggregation configuration.
	Name *string `json:"name,omitempty"`

	// User-friendly alias for the aggregation.
	Label *string `json:"label,omitempty"`

	// Whether users is allowed to select more than one of the aggregation terms.
	MultipleSelectionsAllowed *bool `json:"multiple_selections_allowed,omitempty"`

	// Type of visualization to use when rendering the aggregation.
	VisualizationType *string `json:"visualization_type,omitempty"`
}

ComponentSettingsAggregation : Display settings for aggregations.

type ComponentSettingsFieldsShown

type ComponentSettingsFieldsShown struct {

	// Body label.
	Body *ComponentSettingsFieldsShownBody `json:"body,omitempty"`

	// Title label.
	Title *ComponentSettingsFieldsShownTitle `json:"title,omitempty"`
}

ComponentSettingsFieldsShown : Fields shown in the results section of the UI.

type ComponentSettingsFieldsShownBody

type ComponentSettingsFieldsShownBody struct {

	// Use the whole passage as the body.
	UsePassage *bool `json:"use_passage,omitempty"`

	// Use a specific field as the title.
	Field *string `json:"field,omitempty"`
}

ComponentSettingsFieldsShownBody : Body label.

type ComponentSettingsFieldsShownTitle

type ComponentSettingsFieldsShownTitle struct {

	// Use a specific field as the title.
	Field *string `json:"field,omitempty"`
}

ComponentSettingsFieldsShownTitle : Title label.

type ComponentSettingsResponse

type ComponentSettingsResponse struct {

	// Fields shown in the results section of the UI.
	FieldsShown *ComponentSettingsFieldsShown `json:"fields_shown,omitempty"`

	// Whether or not autocomplete is enabled.
	Autocomplete *bool `json:"autocomplete,omitempty"`

	// Whether or not structured search is enabled.
	StructuredSearch *bool `json:"structured_search,omitempty"`

	// Number or results shown per page.
	ResultsPerPage *int64 `json:"results_per_page,omitempty"`

	// a list of component setting aggregations.
	Aggregations []ComponentSettingsAggregation `json:"aggregations,omitempty"`
}

ComponentSettingsResponse : A response containing the default component settings.

type CreateTrainingQueryOptions

type CreateTrainingQueryOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The natural text query for the training query.
	NaturalLanguageQuery *string `json:"natural_language_query,omitempty"`

	// The filter used on the collection before the **natural_language_query** is applied.
	Filter *string `json:"filter,omitempty"`

	// Array of training examples.
	Examples []TrainingExample `json:"examples,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

CreateTrainingQueryOptions : The CreateTrainingQuery options.

func (*CreateTrainingQueryOptions) SetExamples

func (options *CreateTrainingQueryOptions) SetExamples(examples []TrainingExample) *CreateTrainingQueryOptions

SetExamples : Allow user to set Examples

func (*CreateTrainingQueryOptions) SetFilter

func (options *CreateTrainingQueryOptions) SetFilter(filter string) *CreateTrainingQueryOptions

SetFilter : Allow user to set Filter

func (*CreateTrainingQueryOptions) SetHeaders

func (options *CreateTrainingQueryOptions) SetHeaders(param map[string]string) *CreateTrainingQueryOptions

SetHeaders : Allow user to set Headers

func (*CreateTrainingQueryOptions) SetNaturalLanguageQuery

func (options *CreateTrainingQueryOptions) SetNaturalLanguageQuery(naturalLanguageQuery string) *CreateTrainingQueryOptions

SetNaturalLanguageQuery : Allow user to set NaturalLanguageQuery

func (*CreateTrainingQueryOptions) SetProjectID

func (options *CreateTrainingQueryOptions) SetProjectID(projectID string) *CreateTrainingQueryOptions

SetProjectID : Allow user to set ProjectID

type DeleteDocumentOptions

type DeleteDocumentOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The ID of the collection.
	CollectionID *string `json:"collection_id" validate:"required"`

	// The ID of the document.
	DocumentID *string `json:"document_id" validate:"required"`

	// When `true`, the uploaded document is added to the collection even if the data for that collection is shared with
	// other collections.
	XWatsonDiscoveryForce *bool `json:"X-Watson-Discovery-Force,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

DeleteDocumentOptions : The DeleteDocument options.

func (*DeleteDocumentOptions) SetCollectionID

func (options *DeleteDocumentOptions) SetCollectionID(collectionID string) *DeleteDocumentOptions

SetCollectionID : Allow user to set CollectionID

func (*DeleteDocumentOptions) SetDocumentID

func (options *DeleteDocumentOptions) SetDocumentID(documentID string) *DeleteDocumentOptions

SetDocumentID : Allow user to set DocumentID

func (*DeleteDocumentOptions) SetHeaders

func (options *DeleteDocumentOptions) SetHeaders(param map[string]string) *DeleteDocumentOptions

SetHeaders : Allow user to set Headers

func (*DeleteDocumentOptions) SetProjectID

func (options *DeleteDocumentOptions) SetProjectID(projectID string) *DeleteDocumentOptions

SetProjectID : Allow user to set ProjectID

func (*DeleteDocumentOptions) SetXWatsonDiscoveryForce

func (options *DeleteDocumentOptions) SetXWatsonDiscoveryForce(xWatsonDiscoveryForce bool) *DeleteDocumentOptions

SetXWatsonDiscoveryForce : Allow user to set XWatsonDiscoveryForce

type DeleteDocumentResponse

type DeleteDocumentResponse struct {

	// The unique identifier of the document.
	DocumentID *string `json:"document_id,omitempty"`

	// Status of the document. A deleted document has the status deleted.
	Status *string `json:"status,omitempty"`
}

DeleteDocumentResponse : Information returned when a document is deleted.

type DeleteTrainingQueriesOptions

type DeleteTrainingQueriesOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

DeleteTrainingQueriesOptions : The DeleteTrainingQueries options.

func (*DeleteTrainingQueriesOptions) SetHeaders

SetHeaders : Allow user to set Headers

func (*DeleteTrainingQueriesOptions) SetProjectID

func (options *DeleteTrainingQueriesOptions) SetProjectID(projectID string) *DeleteTrainingQueriesOptions

SetProjectID : Allow user to set ProjectID

type DiscoveryV2

type DiscoveryV2 struct {
	Service *core.BaseService
	Version string
}

DiscoveryV2 : IBM Watson™ Discovery for IBM Cloud Pak for Data is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better decision-making. Securely unify structured and unstructured data with pre-enriched content, and use a simplified query language to eliminate the need for manual filtering of results.

Version: 2.0 See: https://cloud.ibm.com/docs/services/discovery-data/

func NewDiscoveryV2

func NewDiscoveryV2(options *DiscoveryV2Options) (service *DiscoveryV2, err error)

NewDiscoveryV2 : Instantiate DiscoveryV2

func (*DiscoveryV2) AddDocument

func (discovery *DiscoveryV2) AddDocument(addDocumentOptions *AddDocumentOptions) (result *DocumentAccepted, response *core.DetailedResponse, err error)

AddDocument : Add a document Add a document to a collection with optional metadata.

Returns immediately after the system has accepted the document for processing.

 * The user must provide document content, metadata, or both. If the request is missing both document content and

metadata, it is rejected.

  • The user can set the **Content-Type** parameter on the **file** part to indicate the media type of the document.

If the **Content-Type** parameter is missing or is one of the generic media types (for example, `application/octet-stream`), then the service attempts to automatically detect the document's media type.

  • The following field names are reserved and will be filtered out if present after normalization: `id`, `score`,

`highlight`, and any field with the prefix of: `_`, `+`, or `-`

  • Fields with empty name values after normalization are filtered out before indexing.

  • Fields containing the following characters after normalization are filtered out before indexing: `#` and `,`

    If the document is uploaded to a collection that has it's data shared with another collection, the

**X-Watson-Discovery-Force** header must be set to `true`.

**Note:** Documents can be added with a specific **document_id** by using the

**_/v2/projects/{project_id}/collections/{collection_id}/documents** method.

**Note:** This operation only works on collections created to accept direct file uploads. It cannot be used to modify a collection that conects to an external source such as Microsoft SharePoint.

func (*DiscoveryV2) CreateTrainingQuery

func (discovery *DiscoveryV2) CreateTrainingQuery(createTrainingQueryOptions *CreateTrainingQueryOptions) (result *TrainingQuery, response *core.DetailedResponse, err error)

CreateTrainingQuery : Create training query Add a query to the training data for this project. The query can contain a filter and natural language query.

func (*DiscoveryV2) DeleteDocument

func (discovery *DiscoveryV2) DeleteDocument(deleteDocumentOptions *DeleteDocumentOptions) (result *DeleteDocumentResponse, response *core.DetailedResponse, err error)

DeleteDocument : Delete a document If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code `200`) with the status set to 'deleted'.

**Note:** This operation only works on collections created to accept direct file uploads. It cannot be used to modify a collection that conects to an external source such as Microsoft SharePoint.

func (*DiscoveryV2) DeleteTrainingQueries

func (discovery *DiscoveryV2) DeleteTrainingQueries(deleteTrainingQueriesOptions *DeleteTrainingQueriesOptions) (response *core.DetailedResponse, err error)

DeleteTrainingQueries : Delete training queries Removes all training queries for the specified project.

func (*DiscoveryV2) DisableSSLVerification

func (discovery *DiscoveryV2) DisableSSLVerification()

DisableSSLVerification bypasses verification of the server's SSL certificate

func (*DiscoveryV2) GetAutocompletion

func (discovery *DiscoveryV2) GetAutocompletion(getAutocompletionOptions *GetAutocompletionOptions) (result *Completions, response *core.DetailedResponse, err error)

GetAutocompletion : Get Autocomplete Suggestions Returns completion query suggestions for the specified prefix.

func (*DiscoveryV2) GetComponentSettings

func (discovery *DiscoveryV2) GetComponentSettings(getComponentSettingsOptions *GetComponentSettingsOptions) (result *ComponentSettingsResponse, response *core.DetailedResponse, err error)

GetComponentSettings : Configuration settings for components Returns default configuration settings for components.

func (*DiscoveryV2) GetTrainingQuery

func (discovery *DiscoveryV2) GetTrainingQuery(getTrainingQueryOptions *GetTrainingQueryOptions) (result *TrainingQuery, response *core.DetailedResponse, err error)

GetTrainingQuery : Get a training data query Get details for a specific training data query, including the query string and all examples.

func (*DiscoveryV2) ListCollections

func (discovery *DiscoveryV2) ListCollections(listCollectionsOptions *ListCollectionsOptions) (result *ListCollectionsResponse, response *core.DetailedResponse, err error)

ListCollections : List collections Lists existing collections for the specified project.

func (*DiscoveryV2) ListFields

func (discovery *DiscoveryV2) ListFields(listFieldsOptions *ListFieldsOptions) (result *ListFieldsResponse, response *core.DetailedResponse, err error)

ListFields : List fields Gets a list of the unique fields (and their types) stored in the the specified collections.

func (*DiscoveryV2) ListTrainingQueries

func (discovery *DiscoveryV2) ListTrainingQueries(listTrainingQueriesOptions *ListTrainingQueriesOptions) (result *TrainingQuerySet, response *core.DetailedResponse, err error)

ListTrainingQueries : List training queries List the training queries for the specified project.

func (*DiscoveryV2) NewAddDocumentOptions

func (discovery *DiscoveryV2) NewAddDocumentOptions(projectID string, collectionID string) *AddDocumentOptions

NewAddDocumentOptions : Instantiate AddDocumentOptions

func (*DiscoveryV2) NewCreateTrainingQueryOptions

func (discovery *DiscoveryV2) NewCreateTrainingQueryOptions(projectID string) *CreateTrainingQueryOptions

NewCreateTrainingQueryOptions : Instantiate CreateTrainingQueryOptions

func (*DiscoveryV2) NewDeleteDocumentOptions

func (discovery *DiscoveryV2) NewDeleteDocumentOptions(projectID string, collectionID string, documentID string) *DeleteDocumentOptions

NewDeleteDocumentOptions : Instantiate DeleteDocumentOptions

func (*DiscoveryV2) NewDeleteTrainingQueriesOptions

func (discovery *DiscoveryV2) NewDeleteTrainingQueriesOptions(projectID string) *DeleteTrainingQueriesOptions

NewDeleteTrainingQueriesOptions : Instantiate DeleteTrainingQueriesOptions

func (*DiscoveryV2) NewGetAutocompletionOptions

func (discovery *DiscoveryV2) NewGetAutocompletionOptions(projectID string, prefix string) *GetAutocompletionOptions

NewGetAutocompletionOptions : Instantiate GetAutocompletionOptions

func (*DiscoveryV2) NewGetComponentSettingsOptions

func (discovery *DiscoveryV2) NewGetComponentSettingsOptions(projectID string) *GetComponentSettingsOptions

NewGetComponentSettingsOptions : Instantiate GetComponentSettingsOptions

func (*DiscoveryV2) NewGetTrainingQueryOptions

func (discovery *DiscoveryV2) NewGetTrainingQueryOptions(projectID string, queryID string) *GetTrainingQueryOptions

NewGetTrainingQueryOptions : Instantiate GetTrainingQueryOptions

func (*DiscoveryV2) NewListCollectionsOptions

func (discovery *DiscoveryV2) NewListCollectionsOptions(projectID string) *ListCollectionsOptions

NewListCollectionsOptions : Instantiate ListCollectionsOptions

func (*DiscoveryV2) NewListFieldsOptions

func (discovery *DiscoveryV2) NewListFieldsOptions(projectID string) *ListFieldsOptions

NewListFieldsOptions : Instantiate ListFieldsOptions

func (*DiscoveryV2) NewListTrainingQueriesOptions

func (discovery *DiscoveryV2) NewListTrainingQueriesOptions(projectID string) *ListTrainingQueriesOptions

NewListTrainingQueriesOptions : Instantiate ListTrainingQueriesOptions

func (*DiscoveryV2) NewQueryNoticesOptions

func (discovery *DiscoveryV2) NewQueryNoticesOptions(projectID string) *QueryNoticesOptions

NewQueryNoticesOptions : Instantiate QueryNoticesOptions

func (*DiscoveryV2) NewQueryOptions

func (discovery *DiscoveryV2) NewQueryOptions(projectID string) *QueryOptions

NewQueryOptions : Instantiate QueryOptions

func (*DiscoveryV2) NewUpdateDocumentOptions

func (discovery *DiscoveryV2) NewUpdateDocumentOptions(projectID string, collectionID string, documentID string) *UpdateDocumentOptions

NewUpdateDocumentOptions : Instantiate UpdateDocumentOptions

func (*DiscoveryV2) NewUpdateTrainingQueryOptions

func (discovery *DiscoveryV2) NewUpdateTrainingQueryOptions(projectID string, queryID string, naturalLanguageQuery string, examples []TrainingExample) *UpdateTrainingQueryOptions

NewUpdateTrainingQueryOptions : Instantiate UpdateTrainingQueryOptions

func (*DiscoveryV2) Query

func (discovery *DiscoveryV2) Query(queryOptions *QueryOptions) (result *QueryResponse, response *core.DetailedResponse, err error)

Query : Query a project By using this method, you can construct queries. For details, see the [Discovery documentation](https://cloud.ibm.com/docs/services/discovery-data?topic=discovery-data-query-concepts).

func (*DiscoveryV2) QueryNotices

func (discovery *DiscoveryV2) QueryNotices(queryNoticesOptions *QueryNoticesOptions) (result *QueryNoticesResponse, response *core.DetailedResponse, err error)

QueryNotices : Query system notices Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training.

func (*DiscoveryV2) SetServiceURL

func (discovery *DiscoveryV2) SetServiceURL(url string) error

SetServiceURL sets the service URL

func (*DiscoveryV2) UpdateDocument

func (discovery *DiscoveryV2) UpdateDocument(updateDocumentOptions *UpdateDocumentOptions) (result *DocumentAccepted, response *core.DetailedResponse, err error)

UpdateDocument : Update a document Replace an existing document or add a document with a specified **document_id**. Starts ingesting a document with optional metadata.

If the document is uploaded to a collection that has it's data shared with another collection, the **X-Watson-Discovery-Force** header must be set to `true`.

**Note:** When uploading a new document with this method it automatically replaces any document stored with the same **document_id** if it exists.

**Note:** This operation only works on collections created to accept direct file uploads. It cannot be used to modify a collection that conects to an external source such as Microsoft SharePoint.

func (*DiscoveryV2) UpdateTrainingQuery

func (discovery *DiscoveryV2) UpdateTrainingQuery(updateTrainingQueryOptions *UpdateTrainingQueryOptions) (result *TrainingQuery, response *core.DetailedResponse, err error)

UpdateTrainingQuery : Update a training query Updates an existing training query and it's examples.

type DiscoveryV2Options

type DiscoveryV2Options struct {
	URL           string
	Authenticator core.Authenticator
	Version       string
}

DiscoveryV2Options : Service options

type DocumentAccepted

type DocumentAccepted struct {

	// The unique identifier of the ingested document.
	DocumentID *string `json:"document_id,omitempty"`

	// Status of the document in the ingestion process. A status of `processing` is returned for documents that are
	// ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others.
	Status *string `json:"status,omitempty"`
}

DocumentAccepted : Information returned after an uploaded document is accepted.

type DocumentAttribute

type DocumentAttribute struct {

	// The type of attribute.
	Type *string `json:"type,omitempty"`

	// The text associated with the attribute.
	Text *string `json:"text,omitempty"`

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`
}

DocumentAttribute : List of document attributes.

type Field

type Field struct {

	// The name of the field.
	Field *string `json:"field,omitempty"`

	// The type of the field.
	Type *string `json:"type,omitempty"`

	// The collection Id of the collection where the field was found.
	CollectionID *string `json:"collection_id,omitempty"`
}

Field : Object containing field details.

type GetAutocompletionOptions

type GetAutocompletionOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete to `Hot`, `Housing`, or `How
	// do I upgrade`. Possible completions are.
	Prefix *string `json:"prefix" validate:"required"`

	// Comma separated list of the collection IDs. If this parameter is not specified, all collections in the project are
	// used.
	CollectionIds []string `json:"collection_ids,omitempty"`

	// The field in the result documents that autocompletion suggestions are identified from.
	Field *string `json:"field,omitempty"`

	// The number of autocompletion suggestions to return.
	Count *int64 `json:"count,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetAutocompletionOptions : The GetAutocompletion options.

func (*GetAutocompletionOptions) SetCollectionIds

func (options *GetAutocompletionOptions) SetCollectionIds(collectionIds []string) *GetAutocompletionOptions

SetCollectionIds : Allow user to set CollectionIds

func (*GetAutocompletionOptions) SetCount

func (options *GetAutocompletionOptions) SetCount(count int64) *GetAutocompletionOptions

SetCount : Allow user to set Count

func (*GetAutocompletionOptions) SetField

func (options *GetAutocompletionOptions) SetField(field string) *GetAutocompletionOptions

SetField : Allow user to set Field

func (*GetAutocompletionOptions) SetHeaders

func (options *GetAutocompletionOptions) SetHeaders(param map[string]string) *GetAutocompletionOptions

SetHeaders : Allow user to set Headers

func (*GetAutocompletionOptions) SetPrefix

func (options *GetAutocompletionOptions) SetPrefix(prefix string) *GetAutocompletionOptions

SetPrefix : Allow user to set Prefix

func (*GetAutocompletionOptions) SetProjectID

func (options *GetAutocompletionOptions) SetProjectID(projectID string) *GetAutocompletionOptions

SetProjectID : Allow user to set ProjectID

type GetComponentSettingsOptions

type GetComponentSettingsOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetComponentSettingsOptions : The GetComponentSettings options.

func (*GetComponentSettingsOptions) SetHeaders

func (options *GetComponentSettingsOptions) SetHeaders(param map[string]string) *GetComponentSettingsOptions

SetHeaders : Allow user to set Headers

func (*GetComponentSettingsOptions) SetProjectID

func (options *GetComponentSettingsOptions) SetProjectID(projectID string) *GetComponentSettingsOptions

SetProjectID : Allow user to set ProjectID

type GetTrainingQueryOptions

type GetTrainingQueryOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The ID of the query used for training.
	QueryID *string `json:"query_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetTrainingQueryOptions : The GetTrainingQuery options.

func (*GetTrainingQueryOptions) SetHeaders

func (options *GetTrainingQueryOptions) SetHeaders(param map[string]string) *GetTrainingQueryOptions

SetHeaders : Allow user to set Headers

func (*GetTrainingQueryOptions) SetProjectID

func (options *GetTrainingQueryOptions) SetProjectID(projectID string) *GetTrainingQueryOptions

SetProjectID : Allow user to set ProjectID

func (*GetTrainingQueryOptions) SetQueryID

func (options *GetTrainingQueryOptions) SetQueryID(queryID string) *GetTrainingQueryOptions

SetQueryID : Allow user to set QueryID

type ListCollectionsOptions

type ListCollectionsOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

ListCollectionsOptions : The ListCollections options.

func (*ListCollectionsOptions) SetHeaders

func (options *ListCollectionsOptions) SetHeaders(param map[string]string) *ListCollectionsOptions

SetHeaders : Allow user to set Headers

func (*ListCollectionsOptions) SetProjectID

func (options *ListCollectionsOptions) SetProjectID(projectID string) *ListCollectionsOptions

SetProjectID : Allow user to set ProjectID

type ListCollectionsResponse

type ListCollectionsResponse struct {

	// An array containing information about each collection in the project.
	Collections []Collection `json:"collections,omitempty"`
}

ListCollectionsResponse : Response object containing an array of collection details.

type ListFieldsOptions

type ListFieldsOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// Comma separated list of the collection IDs. If this parameter is not specified, all collections in the project are
	// used.
	CollectionIds []string `json:"collection_ids,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

ListFieldsOptions : The ListFields options.

func (*ListFieldsOptions) SetCollectionIds

func (options *ListFieldsOptions) SetCollectionIds(collectionIds []string) *ListFieldsOptions

SetCollectionIds : Allow user to set CollectionIds

func (*ListFieldsOptions) SetHeaders

func (options *ListFieldsOptions) SetHeaders(param map[string]string) *ListFieldsOptions

SetHeaders : Allow user to set Headers

func (*ListFieldsOptions) SetProjectID

func (options *ListFieldsOptions) SetProjectID(projectID string) *ListFieldsOptions

SetProjectID : Allow user to set ProjectID

type ListFieldsResponse

type ListFieldsResponse struct {

	// An array containing information about each field in the collections.
	Fields []Field `json:"fields,omitempty"`
}

ListFieldsResponse : The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with `.properties` (for example,

`warnings.properties.severity` means that the `warnings` object has a property called `severity`).

type ListTrainingQueriesOptions

type ListTrainingQueriesOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

ListTrainingQueriesOptions : The ListTrainingQueries options.

func (*ListTrainingQueriesOptions) SetHeaders

func (options *ListTrainingQueriesOptions) SetHeaders(param map[string]string) *ListTrainingQueriesOptions

SetHeaders : Allow user to set Headers

func (*ListTrainingQueriesOptions) SetProjectID

func (options *ListTrainingQueriesOptions) SetProjectID(projectID string) *ListTrainingQueriesOptions

SetProjectID : Allow user to set ProjectID

type Notice

type Notice struct {

	// Identifies the notice. Many notices might have the same ID. This field exists so that user applications can
	// programmatically identify a notice and take automatic corrective action. Typical notice IDs include: `index_failed`,
	// `index_failed_too_many_requests`, `index_failed_incompatible_field`, `index_failed_cluster_unavailable`,
	// `ingestion_timeout`, `ingestion_error`, `bad_request`, `internal_error`, `missing_model`, `unsupported_model`,
	// `smart_document_understanding_failed_incompatible_field`, `smart_document_understanding_failed_internal_error`,
	// `smart_document_understanding_failed_internal_error`, `smart_document_understanding_failed_warning`,
	// `smart_document_understanding_page_error`, `smart_document_understanding_page_warning`. **Note:** This is not a
	// complete list, other values might be returned.
	NoticeID *string `json:"notice_id,omitempty"`

	// The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
	Created *strfmt.DateTime `json:"created,omitempty"`

	// Unique identifier of the document.
	DocumentID *string `json:"document_id,omitempty"`

	// Unique identifier of the collection.
	CollectionID *string `json:"collection_id,omitempty"`

	// Unique identifier of the query used for relevance training.
	QueryID *string `json:"query_id,omitempty"`

	// Severity level of the notice.
	Severity *string `json:"severity,omitempty"`

	// Ingestion or training step in which the notice occurred.
	Step *string `json:"step,omitempty"`

	// The description of the notice.
	Description *string `json:"description,omitempty"`
}

Notice : A notice produced for the collection.

type QueryAggregation

type QueryAggregation struct {

	// The type of aggregation command used. Options include: term, histogram, timeslice, nested, filter, min, max, sum,
	// average, unique_count, and top_hits.
	Type *string `json:"type" validate:"required"`
}

QueryAggregation : An abstract aggregation type produced by Discovery to analyze the input provided.

type QueryCalculationAggregation

type QueryCalculationAggregation struct {

	// The field to perform the calculation on.
	Field *string `json:"field" validate:"required"`

	// The value of the calculation.
	Value *float64 `json:"value,omitempty"`
}

QueryCalculationAggregation : Returns a scalar calculation across all documents for the field specified. Possible calculations include min, max, sum, average, and unique_count.

type QueryFilterAggregation

type QueryFilterAggregation struct {

	// The filter written in Discovery Query Language syntax applied to the documents before sub aggregations are run.
	Match *string `json:"match" validate:"required"`

	// Number of documents matching the filter.
	MatchingResults *int64 `json:"matching_results" validate:"required"`

	// An array of sub aggregations.
	Aggregations []QueryAggregation `json:"aggregations,omitempty"`
}

QueryFilterAggregation : A modifier that will narrow down the document set of the sub aggregations it precedes.

type QueryHistogramAggregation

type QueryHistogramAggregation struct {

	// The numeric field name used to create the histogram.
	Field *string `json:"field" validate:"required"`

	// The size of the sections the results are split into.
	Interval *int64 `json:"interval" validate:"required"`

	// Array of numeric intervals.
	Results []QueryHistogramAggregationResult `json:"results,omitempty"`
}

QueryHistogramAggregation : Numeric interval segments to categorize documents by using field values from a single numeric field to describe the category.

type QueryHistogramAggregationResult

type QueryHistogramAggregationResult struct {

	// The value of the upper bound for the numeric segment.
	Key *int64 `json:"key" validate:"required"`

	// Number of documents with the specified key as the upper bound.
	MatchingResults *int64 `json:"matching_results" validate:"required"`

	// An array of sub aggregations.
	Aggregations []QueryAggregation `json:"aggregations,omitempty"`
}

QueryHistogramAggregationResult : Histogram numeric interval result.

type QueryLargePassages

type QueryLargePassages struct {

	// A passages query that returns the most relevant passages from the results.
	Enabled *bool `json:"enabled,omitempty"`

	// When `true`, passages will be returned whithin their respective result.
	PerDocument *bool `json:"per_document,omitempty"`

	// Maximum number of passages to return per result.
	MaxPerDocument *int64 `json:"max_per_document,omitempty"`

	// A list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are
	// included.
	Fields []string `json:"fields,omitempty"`

	// The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The
	// default is `10`. The maximum is `100`.
	Count *int64 `json:"count,omitempty"`

	// The approximate number of characters that any one passage will have.
	Characters *int64 `json:"characters,omitempty"`
}

QueryLargePassages : Configuration for passage retrieval.

type QueryLargeSuggestedRefinements

type QueryLargeSuggestedRefinements struct {

	// Whether to perform suggested refinements.
	Enabled *bool `json:"enabled,omitempty"`

	// Maximum number of suggested refinements texts to be returned. The default is `10`. The maximum is `100`.
	Count *int64 `json:"count,omitempty"`
}

QueryLargeSuggestedRefinements : Configuration for suggested refinements.

type QueryLargeTableResults

type QueryLargeTableResults struct {

	// Whether to enable table retrieval.
	Enabled *bool `json:"enabled,omitempty"`

	// Maximum number of tables to return.
	Count *int64 `json:"count,omitempty"`
}

QueryLargeTableResults : Configuration for table retrieval.

type QueryNestedAggregation

type QueryNestedAggregation struct {

	// The path to the document field to scope sub aggregations to.
	Path *string `json:"path" validate:"required"`

	// Number of nested documents found in the specified field.
	MatchingResults *int64 `json:"matching_results" validate:"required"`

	// An array of sub aggregations.
	Aggregations []QueryAggregation `json:"aggregations,omitempty"`
}

QueryNestedAggregation : A restriction that alter the document set used for sub aggregations it precedes to nested documents found in the field specified.

type QueryNoticesOptions

type QueryNoticesOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// A cacheable query that excludes documents that don't mention the query content. Filter searches are better for
	// metadata-type searches and for assessing the concepts in the data set.
	Filter *string `json:"filter,omitempty"`

	// A query search returns all documents in your data set with full enrichments and full text, but with the most
	// relevant documents listed first.
	Query *string `json:"query,omitempty"`

	// A natural language query that returns relevant documents by utilizing training data and natural language
	// understanding.
	NaturalLanguageQuery *string `json:"natural_language_query,omitempty"`

	// Number of results to return. The maximum for the **count** and **offset** values together in any one query is
	// **10000**.
	Count *int64 `json:"count,omitempty"`

	// 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. The maximum for the **count** and **offset** values
	// together in any one query is **10000**.
	Offset *int64 `json:"offset,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

QueryNoticesOptions : The QueryNotices options.

func (*QueryNoticesOptions) SetCount

func (options *QueryNoticesOptions) SetCount(count int64) *QueryNoticesOptions

SetCount : Allow user to set Count

func (*QueryNoticesOptions) SetFilter

func (options *QueryNoticesOptions) SetFilter(filter string) *QueryNoticesOptions

SetFilter : Allow user to set Filter

func (*QueryNoticesOptions) SetHeaders

func (options *QueryNoticesOptions) SetHeaders(param map[string]string) *QueryNoticesOptions

SetHeaders : Allow user to set Headers

func (*QueryNoticesOptions) SetNaturalLanguageQuery

func (options *QueryNoticesOptions) SetNaturalLanguageQuery(naturalLanguageQuery string) *QueryNoticesOptions

SetNaturalLanguageQuery : Allow user to set NaturalLanguageQuery

func (*QueryNoticesOptions) SetOffset

func (options *QueryNoticesOptions) SetOffset(offset int64) *QueryNoticesOptions

SetOffset : Allow user to set Offset

func (*QueryNoticesOptions) SetProjectID

func (options *QueryNoticesOptions) SetProjectID(projectID string) *QueryNoticesOptions

SetProjectID : Allow user to set ProjectID

func (*QueryNoticesOptions) SetQuery

func (options *QueryNoticesOptions) SetQuery(query string) *QueryNoticesOptions

SetQuery : Allow user to set Query

type QueryNoticesResponse

type QueryNoticesResponse struct {

	// The number of matching results.
	MatchingResults *int64 `json:"matching_results,omitempty"`

	// Array of document results that match the query.
	Notices []Notice `json:"notices,omitempty"`
}

QueryNoticesResponse : Object containing notice query results.

type QueryOptions

type QueryOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// A comma-separated list of collection IDs to be queried against.
	CollectionIds []string `json:"collection_ids,omitempty"`

	// A cacheable query that excludes documents that don't mention the query content. Filter searches are better for
	// metadata-type searches and for assessing the concepts in the data set.
	Filter *string `json:"filter,omitempty"`

	// A query search returns all documents in your data set with full enrichments and full text, but with the most
	// relevant documents listed first. Use a query search when you want to find the most relevant search results.
	Query *string `json:"query,omitempty"`

	// A natural language query that returns relevant documents by utilizing training data and natural language
	// understanding.
	NaturalLanguageQuery *string `json:"natural_language_query,omitempty"`

	// 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 a full list of possible aggregations, see the Query reference.
	Aggregation *string `json:"aggregation,omitempty"`

	// Number of results to return.
	Count *int64 `json:"count,omitempty"`

	// A list of the fields in the document hierarchy to return. If this parameter not specified, then all top-level fields
	// are returned.
	Return []string `json:"return,omitempty"`

	// 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.
	Offset *int64 `json:"offset,omitempty"`

	// 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. This parameter cannot be used in the same query as the **bias** parameter.
	Sort *string `json:"sort,omitempty"`

	// When `true`, a highlight field is returned for each result which contains the fields which match the query with
	// `<em></em>` tags around the matching query terms.
	Highlight *bool `json:"highlight,omitempty"`

	// 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).
	SpellingSuggestions *bool `json:"spelling_suggestions,omitempty"`

	// Configuration for table retrieval.
	TableResults *QueryLargeTableResults `json:"table_results,omitempty"`

	// Configuration for suggested refinements.
	SuggestedRefinements *QueryLargeSuggestedRefinements `json:"suggested_refinements,omitempty"`

	// Configuration for passage retrieval.
	Passages *QueryLargePassages `json:"passages,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

QueryOptions : The Query options.

func (*QueryOptions) SetAggregation

func (options *QueryOptions) SetAggregation(aggregation string) *QueryOptions

SetAggregation : Allow user to set Aggregation

func (*QueryOptions) SetCollectionIds

func (options *QueryOptions) SetCollectionIds(collectionIds []string) *QueryOptions

SetCollectionIds : Allow user to set CollectionIds

func (*QueryOptions) SetCount

func (options *QueryOptions) SetCount(count int64) *QueryOptions

SetCount : Allow user to set Count

func (*QueryOptions) SetFilter

func (options *QueryOptions) SetFilter(filter string) *QueryOptions

SetFilter : Allow user to set Filter

func (*QueryOptions) SetHeaders

func (options *QueryOptions) SetHeaders(param map[string]string) *QueryOptions

SetHeaders : Allow user to set Headers

func (*QueryOptions) SetHighlight

func (options *QueryOptions) SetHighlight(highlight bool) *QueryOptions

SetHighlight : Allow user to set Highlight

func (*QueryOptions) SetNaturalLanguageQuery

func (options *QueryOptions) SetNaturalLanguageQuery(naturalLanguageQuery string) *QueryOptions

SetNaturalLanguageQuery : Allow user to set NaturalLanguageQuery

func (*QueryOptions) SetOffset

func (options *QueryOptions) SetOffset(offset int64) *QueryOptions

SetOffset : Allow user to set Offset

func (*QueryOptions) SetPassages

func (options *QueryOptions) SetPassages(passages *QueryLargePassages) *QueryOptions

SetPassages : Allow user to set Passages

func (*QueryOptions) SetProjectID

func (options *QueryOptions) SetProjectID(projectID string) *QueryOptions

SetProjectID : Allow user to set ProjectID

func (*QueryOptions) SetQuery

func (options *QueryOptions) SetQuery(query string) *QueryOptions

SetQuery : Allow user to set Query

func (*QueryOptions) SetReturn

func (options *QueryOptions) SetReturn(returnVar []string) *QueryOptions

SetReturn : Allow user to set Return

func (*QueryOptions) SetSort

func (options *QueryOptions) SetSort(sort string) *QueryOptions

SetSort : Allow user to set Sort

func (*QueryOptions) SetSpellingSuggestions

func (options *QueryOptions) SetSpellingSuggestions(spellingSuggestions bool) *QueryOptions

SetSpellingSuggestions : Allow user to set SpellingSuggestions

func (*QueryOptions) SetSuggestedRefinements

func (options *QueryOptions) SetSuggestedRefinements(suggestedRefinements *QueryLargeSuggestedRefinements) *QueryOptions

SetSuggestedRefinements : Allow user to set SuggestedRefinements

func (*QueryOptions) SetTableResults

func (options *QueryOptions) SetTableResults(tableResults *QueryLargeTableResults) *QueryOptions

SetTableResults : Allow user to set TableResults

type QueryResponse

type QueryResponse struct {

	// The number of matching results for the query.
	MatchingResults *int64 `json:"matching_results,omitempty"`

	// Array of document results for the query.
	Results []QueryResult `json:"results,omitempty"`

	// Array of aggregations for the query.
	Aggregations []QueryAggregation `json:"aggregations,omitempty"`

	// An object contain retrieval type information.
	RetrievalDetails *RetrievalDetails `json:"retrieval_details,omitempty"`

	// Suggested correction to the submitted **natural_language_query** value.
	SuggestedQuery *string `json:"suggested_query,omitempty"`

	// Array of suggested refinments.
	SuggestedRefinements []QuerySuggestedRefinement `json:"suggested_refinements,omitempty"`

	// Array of table results.
	TableResults []QueryTableResult `json:"table_results,omitempty"`
}

QueryResponse : A response containing the documents and aggregations for the query.

type QueryResult

type QueryResult map[string]interface{}

QueryResult : Result document for the specified query.

func (*QueryResult) GetDocumentID

func (this *QueryResult) GetDocumentID() *string

GetDocumentID : Allow user to get DocumentID

func (*QueryResult) GetDocumentPassages

func (this *QueryResult) GetDocumentPassages() *[]QueryResultPassage

GetDocumentPassages : Allow user to get DocumentPassages

func (*QueryResult) GetMetadata

func (this *QueryResult) GetMetadata() *map[string]interface{}

GetMetadata : Allow user to get Metadata

func (*QueryResult) GetProperty

func (this *QueryResult) GetProperty(Key string) *interface{}

GetProperty : Allow user to get arbitrary property

func (*QueryResult) GetResultMetadata

func (this *QueryResult) GetResultMetadata() *QueryResultMetadata

GetResultMetadata : Allow user to get ResultMetadata

func (*QueryResult) SetDocumentID

func (this *QueryResult) SetDocumentID(DocumentID *string)

SetDocumentID : Allow user to set DocumentID

func (*QueryResult) SetDocumentPassages

func (this *QueryResult) SetDocumentPassages(DocumentPassages *[]QueryResultPassage)

SetDocumentPassages : Allow user to set DocumentPassages

func (*QueryResult) SetMetadata

func (this *QueryResult) SetMetadata(Metadata *map[string]interface{})

SetMetadata : Allow user to set Metadata

func (*QueryResult) SetProperty

func (this *QueryResult) SetProperty(Key string, Value *interface{})

SetProperty : Allow user to set arbitrary property

func (*QueryResult) SetResultMetadata

func (this *QueryResult) SetResultMetadata(ResultMetadata *QueryResultMetadata)

SetResultMetadata : Allow user to set ResultMetadata

type QueryResultMetadata

type QueryResultMetadata struct {

	// The document retrieval source that produced this search result.
	DocumentRetrievalSource *string `json:"document_retrieval_source,omitempty"`

	// The collection id associated with this training data set.
	CollectionID *string `json:"collection_id" validate:"required"`

	// The confidence score for the given result. Calculated based on how relevant the result is estimated to be.
	// confidence can range from `0.0` to `1.0`. The higher the number, the more relevant the document. The `confidence`
	// value for a result was calculated using the model specified in the `document_retrieval_strategy` field of the result
	// set. This field is only returned if the **natural_language_query** parameter is specified in the query.
	Confidence *float64 `json:"confidence,omitempty"`
}

QueryResultMetadata : Metadata of a query result.

type QueryResultPassage

type QueryResultPassage struct {

	// The content of the extracted passage.
	PassageText *string `json:"passage_text,omitempty"`

	// The position of the first character of the extracted passage in the originating field.
	StartOffset *int64 `json:"start_offset,omitempty"`

	// The position of the last character of the extracted passage in the originating field.
	EndOffset *int64 `json:"end_offset,omitempty"`

	// The label of the field from which the passage has been extracted.
	Field *string `json:"field,omitempty"`
}

QueryResultPassage : A passage query result.

type QuerySuggestedRefinement

type QuerySuggestedRefinement struct {

	// The text used to filter.
	Text *string `json:"text,omitempty"`
}

QuerySuggestedRefinement : A suggested additional query term or terms user to filter results.

type QueryTableResult

type QueryTableResult struct {

	// The identifier for the retrieved table.
	TableID *string `json:"table_id,omitempty"`

	// The identifier of the document the table was retrieved from.
	SourceDocumentID *string `json:"source_document_id,omitempty"`

	// The identifier of the collection the table was retrieved from.
	CollectionID *string `json:"collection_id,omitempty"`

	// HTML snippet of the table info.
	TableHTML *string `json:"table_html,omitempty"`

	// The offset of the table html snippet in the original document html.
	TableHTMLOffset *int64 `json:"table_html_offset,omitempty"`

	// Full table object retrieved from Table Understanding Enrichment.
	Table *TableResultTable `json:"table,omitempty"`
}

QueryTableResult : A tables whose content or context match a search query.

type QueryTermAggregation

type QueryTermAggregation struct {

	// The field in the document used to generate top values from.
	Field *string `json:"field" validate:"required"`

	// The number of top values returned.
	Count *int64 `json:"count,omitempty"`

	// Array of top values for the field.
	Results []QueryTermAggregationResult `json:"results,omitempty"`
}

QueryTermAggregation : Returns the top values for the field specified.

type QueryTermAggregationResult

type QueryTermAggregationResult struct {

	// Value of the field with a non-zero frequency in the document set.
	Key *string `json:"key" validate:"required"`

	// Number of documents containing the 'key'.
	MatchingResults *int64 `json:"matching_results" validate:"required"`

	// An array of sub aggregations.
	Aggregations []QueryAggregation `json:"aggregations,omitempty"`
}

QueryTermAggregationResult : Top value result for the term aggregation.

type QueryTimesliceAggregation

type QueryTimesliceAggregation struct {

	// The date field name used to create the timeslice.
	Field *string `json:"field" validate:"required"`

	// The date interval value. Valid values are seconds, minutes, hours, days, weeks, and years.
	Interval *string `json:"interval" validate:"required"`

	// Array of aggregation results.
	Results []QueryTimesliceAggregationResult `json:"results,omitempty"`
}

QueryTimesliceAggregation : A specialized histogram aggregation that uses dates to create interval segments.

type QueryTimesliceAggregationResult

type QueryTimesliceAggregationResult struct {

	// String date value of the upper bound for the timeslice interval in ISO-8601 format.
	KeyAsString *string `json:"key_as_string" validate:"required"`

	// Numeric date value of the upper bound for the timeslice interval in UNIX miliseconds since epoch.
	Key *int64 `json:"key" validate:"required"`

	// Number of documents with the specified key as the upper bound.
	MatchingResults *int64 `json:"matching_results" validate:"required"`

	// An array of sub aggregations.
	Aggregations []QueryAggregation `json:"aggregations,omitempty"`
}

QueryTimesliceAggregationResult : A timeslice interval segment.

type QueryTopHitsAggregation

type QueryTopHitsAggregation struct {

	// The number of documents to return.
	Size *int64 `json:"size" validate:"required"`

	Hits *QueryTopHitsAggregationResult `json:"hits,omitempty"`
}

QueryTopHitsAggregation : Returns the top documents ranked by the score of the query.

type QueryTopHitsAggregationResult

type QueryTopHitsAggregationResult struct {

	// Number of matching results.
	MatchingResults *int64 `json:"matching_results" validate:"required"`

	// An array of the document results.
	Hits []map[string]interface{} `json:"hits,omitempty"`
}

QueryTopHitsAggregationResult : A query response containing the matching documents for the preceding aggregations.

type RetrievalDetails

type RetrievalDetails struct {

	// Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results
	// were returned using a relevancy trained model.
	//
	//  **Note**: In the event of trained collections being queried, but the trained model is not used to return results,
	// the **document_retrieval_strategy** will be listed as `untrained`.
	DocumentRetrievalStrategy *string `json:"document_retrieval_strategy,omitempty"`
}

RetrievalDetails : An object contain retrieval type information.

type TableBodyCells

type TableBodyCells struct {

	// The unique ID of the cell in the current table.
	CellID *string `json:"cell_id,omitempty"`

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`

	// The textual contents of this cell from the input document without associated markup content.
	Text *string `json:"text,omitempty"`

	// The `begin` index of this cell's `row` location in the current table.
	RowIndexBegin *int64 `json:"row_index_begin,omitempty"`

	// The `end` index of this cell's `row` location in the current table.
	RowIndexEnd *int64 `json:"row_index_end,omitempty"`

	// The `begin` index of this cell's `column` location in the current table.
	ColumnIndexBegin *int64 `json:"column_index_begin,omitempty"`

	// The `end` index of this cell's `column` location in the current table.
	ColumnIndexEnd *int64 `json:"column_index_end,omitempty"`

	// A list of table row header ids.
	RowHeaderIds []TableRowHeaderIds `json:"row_header_ids,omitempty"`

	// A list of table row header texts.
	RowHeaderTexts []TableRowHeaderTexts `json:"row_header_texts,omitempty"`

	// A list of table row header texts normalized.
	RowHeaderTextsNormalized []TableRowHeaderTextsNormalized `json:"row_header_texts_normalized,omitempty"`

	// A list of table column header ids.
	ColumnHeaderIds []TableColumnHeaderIds `json:"column_header_ids,omitempty"`

	// A list of table column header texts.
	ColumnHeaderTexts []TableColumnHeaderTexts `json:"column_header_texts,omitempty"`

	// A list of table column header texts normalized.
	ColumnHeaderTextsNormalized []TableColumnHeaderTextsNormalized `json:"column_header_texts_normalized,omitempty"`

	// A list of document attributes.
	Attributes []DocumentAttribute `json:"attributes,omitempty"`
}

TableBodyCells : Cells that are not table header, column header, or row header cells.

type TableCellKey

type TableCellKey struct {

	// The unique ID of the key in the table.
	CellID *string `json:"cell_id,omitempty"`

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`

	// The text content of the table cell without HTML markup.
	Text *string `json:"text,omitempty"`
}

TableCellKey : A key in a key-value pair.

type TableCellValues

type TableCellValues struct {

	// The unique ID of the value in the table.
	CellID *string `json:"cell_id,omitempty"`

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`

	// The text content of the table cell without HTML markup.
	Text *string `json:"text,omitempty"`
}

TableCellValues : A value in a key-value pair.

type TableColumnHeaderIds

type TableColumnHeaderIds struct {

	// The `id` value of a column header.
	ID *string `json:"id,omitempty"`
}

TableColumnHeaderIds : An array of values, each being the `id` value of a column header that is applicable to the current cell.

type TableColumnHeaderTexts

type TableColumnHeaderTexts struct {

	// The `text` value of a column header.
	Text *string `json:"text,omitempty"`
}

TableColumnHeaderTexts : An array of values, each being the `text` value of a column header that is applicable to the current cell.

type TableColumnHeaderTextsNormalized

type TableColumnHeaderTextsNormalized struct {

	// The normalized version of a column header text.
	TextNormalized *string `json:"text_normalized,omitempty"`
}

TableColumnHeaderTextsNormalized : If you provide customization input, the normalized version of the column header texts according to the customization; otherwise, the same value as `column_header_texts`.

type TableColumnHeaders

type TableColumnHeaders struct {

	// The unique ID of the cell in the current table.
	CellID *string `json:"cell_id,omitempty"`

	// The location of the column header cell in the current table as defined by its `begin` and `end` offsets,
	// respectfully, in the input document.
	Location interface{} `json:"location,omitempty"`

	// The textual contents of this cell from the input document without associated markup content.
	Text *string `json:"text,omitempty"`

	// If you provide customization input, the normalized version of the cell text according to the customization;
	// otherwise, the same value as `text`.
	TextNormalized *string `json:"text_normalized,omitempty"`

	// The `begin` index of this cell's `row` location in the current table.
	RowIndexBegin *int64 `json:"row_index_begin,omitempty"`

	// The `end` index of this cell's `row` location in the current table.
	RowIndexEnd *int64 `json:"row_index_end,omitempty"`

	// The `begin` index of this cell's `column` location in the current table.
	ColumnIndexBegin *int64 `json:"column_index_begin,omitempty"`

	// The `end` index of this cell's `column` location in the current table.
	ColumnIndexEnd *int64 `json:"column_index_end,omitempty"`
}

TableColumnHeaders : Column-level cells, each applicable as a header to other cells in the same column as itself, of the current table.

type TableElementLocation

type TableElementLocation struct {

	// The element's `begin` index.
	Begin *int64 `json:"begin" validate:"required"`

	// The element's `end` index.
	End *int64 `json:"end" validate:"required"`
}

TableElementLocation : The numeric location of the identified element in the document, represented with two integers labeled `begin` and `end`.

type TableHeaders

type TableHeaders struct {

	// The unique ID of the cell in the current table.
	CellID *string `json:"cell_id,omitempty"`

	// The location of the table header cell in the current table as defined by its `begin` and `end` offsets,
	// respectfully, in the input document.
	Location interface{} `json:"location,omitempty"`

	// The textual contents of the cell from the input document without associated markup content.
	Text *string `json:"text,omitempty"`

	// The `begin` index of this cell's `row` location in the current table.
	RowIndexBegin *int64 `json:"row_index_begin,omitempty"`

	// The `end` index of this cell's `row` location in the current table.
	RowIndexEnd *int64 `json:"row_index_end,omitempty"`

	// The `begin` index of this cell's `column` location in the current table.
	ColumnIndexBegin *int64 `json:"column_index_begin,omitempty"`

	// The `end` index of this cell's `column` location in the current table.
	ColumnIndexEnd *int64 `json:"column_index_end,omitempty"`
}

TableHeaders : The contents of the current table's header.

type TableKeyValuePairs

type TableKeyValuePairs struct {

	// A key in a key-value pair.
	Key *TableCellKey `json:"key,omitempty"`

	// A list of values in a key-value pair.
	Value []TableCellValues `json:"value,omitempty"`
}

TableKeyValuePairs : Key-value pairs detected across cell boundaries.

type TableResultTable

type TableResultTable struct {

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`

	// The textual contents of the current table from the input document without associated markup content.
	Text *string `json:"text,omitempty"`

	// Text and associated location within a table.
	SectionTitle *TableTextLocation `json:"section_title,omitempty"`

	// Text and associated location within a table.
	Title *TableTextLocation `json:"title,omitempty"`

	// An array of table-level cells that apply as headers to all the other cells in the current table.
	TableHeaders []TableHeaders `json:"table_headers,omitempty"`

	// An array of row-level cells, each applicable as a header to other cells in the same row as itself, of the current
	// table.
	RowHeaders []TableRowHeaders `json:"row_headers,omitempty"`

	// An array of column-level cells, each applicable as a header to other cells in the same column as itself, of the
	// current table.
	ColumnHeaders []TableColumnHeaders `json:"column_headers,omitempty"`

	// An array of key-value pairs identified in the current table.
	KeyValuePairs []TableKeyValuePairs `json:"key_value_pairs,omitempty"`

	// An array of cells that are neither table header nor column header nor row header cells, of the current table with
	// corresponding row and column header associations.
	BodyCells []TableBodyCells `json:"body_cells,omitempty"`

	// An array of lists of textual entries across the document related to the current table being parsed.
	Contexts []TableTextLocation `json:"contexts,omitempty"`
}

TableResultTable : Full table object retrieved from Table Understanding Enrichment.

type TableRowHeaderIds

type TableRowHeaderIds struct {

	// The `id` values of a row header.
	ID *string `json:"id,omitempty"`
}

TableRowHeaderIds : An array of values, each being the `id` value of a row header that is applicable to this body cell.

type TableRowHeaderTexts

type TableRowHeaderTexts struct {

	// The `text` value of a row header.
	Text *string `json:"text,omitempty"`
}

TableRowHeaderTexts : An array of values, each being the `text` value of a row header that is applicable to this body cell.

type TableRowHeaderTextsNormalized

type TableRowHeaderTextsNormalized struct {

	// The normalized version of a row header text.
	TextNormalized *string `json:"text_normalized,omitempty"`
}

TableRowHeaderTextsNormalized : If you provide customization input, the normalized version of the row header texts according to the customization; otherwise, the same value as `row_header_texts`.

type TableRowHeaders

type TableRowHeaders struct {

	// The unique ID of the cell in the current table.
	CellID *string `json:"cell_id,omitempty"`

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`

	// The textual contents of this cell from the input document without associated markup content.
	Text *string `json:"text,omitempty"`

	// If you provide customization input, the normalized version of the cell text according to the customization;
	// otherwise, the same value as `text`.
	TextNormalized *string `json:"text_normalized,omitempty"`

	// The `begin` index of this cell's `row` location in the current table.
	RowIndexBegin *int64 `json:"row_index_begin,omitempty"`

	// The `end` index of this cell's `row` location in the current table.
	RowIndexEnd *int64 `json:"row_index_end,omitempty"`

	// The `begin` index of this cell's `column` location in the current table.
	ColumnIndexBegin *int64 `json:"column_index_begin,omitempty"`

	// The `end` index of this cell's `column` location in the current table.
	ColumnIndexEnd *int64 `json:"column_index_end,omitempty"`
}

TableRowHeaders : Row-level cells, each applicable as a header to other cells in the same row as itself, of the current table.

type TableTextLocation

type TableTextLocation struct {

	// The text retrieved.
	Text *string `json:"text,omitempty"`

	// The numeric location of the identified element in the document, represented with two integers labeled `begin` and
	// `end`.
	Location *TableElementLocation `json:"location,omitempty"`
}

TableTextLocation : Text and associated location within a table.

type TrainingExample

type TrainingExample struct {

	// The document ID associated with this training example.
	DocumentID *string `json:"document_id" validate:"required"`

	// The collection ID associated with this training example.
	CollectionID *string `json:"collection_id" validate:"required"`

	// The relevance of the training example.
	Relevance *int64 `json:"relevance" validate:"required"`

	// The date and time the example was created.
	Created *strfmt.DateTime `json:"created,omitempty"`

	// The date and time the example was updated.
	Updated *strfmt.DateTime `json:"updated,omitempty"`
}

TrainingExample : Object containing example response details for a training query.

type TrainingQuery

type TrainingQuery struct {

	// The query ID associated with the training query.
	QueryID *string `json:"query_id,omitempty"`

	// The natural text query for the training query.
	NaturalLanguageQuery *string `json:"natural_language_query" validate:"required"`

	// The filter used on the collection before the **natural_language_query** is applied.
	Filter *string `json:"filter,omitempty"`

	// The date and time the query was created.
	Created *strfmt.DateTime `json:"created,omitempty"`

	// The date and time the query was updated.
	Updated *strfmt.DateTime `json:"updated,omitempty"`

	// Array of training examples.
	Examples []TrainingExample `json:"examples" validate:"required"`
}

TrainingQuery : Object containing training query details.

type TrainingQuerySet

type TrainingQuerySet struct {

	// Array of training queries.
	Queries []TrainingQuery `json:"queries,omitempty"`
}

TrainingQuerySet : Object specifying the training queries contained in the identified training set.

type UpdateDocumentOptions

type UpdateDocumentOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The ID of the collection.
	CollectionID *string `json:"collection_id" validate:"required"`

	// The ID of the document.
	DocumentID *string `json:"document_id" validate:"required"`

	// The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50
	// megabytes, the maximum supported file size when testing a confiruration is 1 megabyte. Files larger than the
	// supported size are rejected.
	File io.ReadCloser `json:"file,omitempty"`

	// The filename for file.
	Filename *string `json:"filename,omitempty"`

	// The content type of file.
	FileContentType *string `json:"file_content_type,omitempty"`

	// The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:  “` {
	//   "Creator": "Johnny Appleseed",
	//   "Subject": "Apples"
	// } “`.
	Metadata *string `json:"metadata,omitempty"`

	// When `true`, the uploaded document is added to the collection even if the data for that collection is shared with
	// other collections.
	XWatsonDiscoveryForce *bool `json:"X-Watson-Discovery-Force,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

UpdateDocumentOptions : The UpdateDocument options.

func (*UpdateDocumentOptions) SetCollectionID

func (options *UpdateDocumentOptions) SetCollectionID(collectionID string) *UpdateDocumentOptions

SetCollectionID : Allow user to set CollectionID

func (*UpdateDocumentOptions) SetDocumentID

func (options *UpdateDocumentOptions) SetDocumentID(documentID string) *UpdateDocumentOptions

SetDocumentID : Allow user to set DocumentID

func (*UpdateDocumentOptions) SetFile

func (options *UpdateDocumentOptions) SetFile(file io.ReadCloser) *UpdateDocumentOptions

SetFile : Allow user to set File

func (*UpdateDocumentOptions) SetFileContentType

func (options *UpdateDocumentOptions) SetFileContentType(fileContentType string) *UpdateDocumentOptions

SetFileContentType : Allow user to set FileContentType

func (*UpdateDocumentOptions) SetFilename

func (options *UpdateDocumentOptions) SetFilename(filename string) *UpdateDocumentOptions

SetFilename : Allow user to set Filename

func (*UpdateDocumentOptions) SetHeaders

func (options *UpdateDocumentOptions) SetHeaders(param map[string]string) *UpdateDocumentOptions

SetHeaders : Allow user to set Headers

func (*UpdateDocumentOptions) SetMetadata

func (options *UpdateDocumentOptions) SetMetadata(metadata string) *UpdateDocumentOptions

SetMetadata : Allow user to set Metadata

func (*UpdateDocumentOptions) SetProjectID

func (options *UpdateDocumentOptions) SetProjectID(projectID string) *UpdateDocumentOptions

SetProjectID : Allow user to set ProjectID

func (*UpdateDocumentOptions) SetXWatsonDiscoveryForce

func (options *UpdateDocumentOptions) SetXWatsonDiscoveryForce(xWatsonDiscoveryForce bool) *UpdateDocumentOptions

SetXWatsonDiscoveryForce : Allow user to set XWatsonDiscoveryForce

type UpdateTrainingQueryOptions

type UpdateTrainingQueryOptions struct {

	// The ID of the project. This information can be found from the deploy page of the Discovery administrative tooling.
	ProjectID *string `json:"project_id" validate:"required"`

	// The ID of the query used for training.
	QueryID *string `json:"query_id" validate:"required"`

	// The natural text query for the training query.
	NaturalLanguageQuery *string `json:"natural_language_query" validate:"required"`

	// Array of training examples.
	Examples []TrainingExample `json:"examples" validate:"required"`

	// The filter used on the collection before the **natural_language_query** is applied.
	Filter *string `json:"filter,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

UpdateTrainingQueryOptions : The UpdateTrainingQuery options.

func (*UpdateTrainingQueryOptions) SetExamples

func (options *UpdateTrainingQueryOptions) SetExamples(examples []TrainingExample) *UpdateTrainingQueryOptions

SetExamples : Allow user to set Examples

func (*UpdateTrainingQueryOptions) SetFilter

func (options *UpdateTrainingQueryOptions) SetFilter(filter string) *UpdateTrainingQueryOptions

SetFilter : Allow user to set Filter

func (*UpdateTrainingQueryOptions) SetHeaders

func (options *UpdateTrainingQueryOptions) SetHeaders(param map[string]string) *UpdateTrainingQueryOptions

SetHeaders : Allow user to set Headers

func (*UpdateTrainingQueryOptions) SetNaturalLanguageQuery

func (options *UpdateTrainingQueryOptions) SetNaturalLanguageQuery(naturalLanguageQuery string) *UpdateTrainingQueryOptions

SetNaturalLanguageQuery : Allow user to set NaturalLanguageQuery

func (*UpdateTrainingQueryOptions) SetProjectID

func (options *UpdateTrainingQueryOptions) SetProjectID(projectID string) *UpdateTrainingQueryOptions

SetProjectID : Allow user to set ProjectID

func (*UpdateTrainingQueryOptions) SetQueryID

func (options *UpdateTrainingQueryOptions) SetQueryID(queryID string) *UpdateTrainingQueryOptions

SetQueryID : Allow user to set QueryID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL