Skip to content

Latest commit

 

History

History
1703 lines (776 loc) · 28.4 KB

File metadata and controls

1703 lines (776 loc) · 28.4 KB

Home > @yext/search-headless

search-headless package

Classes

Class

Description

SearchCore

Provides methods for executing searches, submitting questions, and performing autocompletes.

SearchError

Represents an error

SearchHeadless

Provides the functionality for interacting with a Search experience.

Enumerations

Enumeration

Description

AppliedQueryFilterType

Represents the type of AppliedQueryFilter applied to a search.

BuiltInFieldType

Possible built-in field types for DirectAnswer.fieldType.

CloudChoice

Defines the cloud choice of the API domains.

CloudRegion

Defines the cloud region of the API domains.

DirectAnswerType

Represents the type of direct answer.

Direction

The direction of a sort.

Environment

Defines the environment of the API domains.

ErrorType

Identifier for the type of error causing the failure.

FilterCombinator

Indicates how child filters in a StaticFilter should be combined.

LocationBiasMethod

The method used to determine the location.

Matcher

A Matcher is a filtering operation.

QuerySource

The source of the search request.

QueryTrigger

Describes the ways a search can be executed besides user input.

SearchIntent

Represents intents from the Search API.

SearchTypeEnum

An enum which indicates the type of search that Headless is managing.

SortType

The method of sorting.

Source

Represents the source of a Result.

SpellCheckType

Represents the type of spell check performed.

Functions

Function

Description

combineStaticFilters(filterA, filterB, combinator)

Creates a StaticFilter by applying the specified FilterCombinator to the two static filters. Throws an error if an attempt is made to combine a conjunction static filter using FilterCombinator.OR.

createDateRangeStaticFilter(fieldId, range)

Creates a StaticFilter that matches all results where the given field value falls in a specific Date BoundedRange.

createEqualsStaticFilter(fieldId, value)

Creates a FieldValueStaticFilter that ensures all results will match a specific field value.

createNearMeStaticFilter(position)

Creates a FieldValueStaticFilter that matches all results within a certain radius of the given position.

createNumberRangeStaticFilter(fieldId, range)

Creates a StaticFilter that matches all results where the given field value falls in a specific number BoundedRange.

provideHeadless(config)

Supplies a new instance of SearchHeadless, using the provided configuration.

Interfaces

Interface

Description

AdditionalHttpHeaders

AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers.

Address

An interface with address fields to use in BaseFieldValueDirectAnswer.value.

AddressDirectAnswer

A BaseFieldValueDirectAnswer interface with 'address' field type.

AllResultsForVertical

Represents all results for the current vertical.

AndroidAppUrlDirectAnswer

A direct answer for an android app url field.

AppliedQueryFilter

A filter that the Search API applied to the search.

AutocompleteResponse

The response of a universal or vertical autocomplete request.

AutocompleteResult

An autocomplete suggestion.

AutocompleteService

A service for autocomplete requests.

BaseFeaturedSnippetDirectAnswer

A direct answer which was found within a document.

BaseFieldValueDirectAnswer

A direct answer where the answer came from a field from the knowledge graph.

BaseSearchConfig

The base configuration options for SearchCore, which includes the options from ServingConfig.

BoundedRange

An interface representing a range of values of type T.

ClientSDKHeaderValues

Additional agents and their versions used to create the Search experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS_CORE agent.

ComplexURL

The shape of a BuiltInFieldType.ComplexURL DirectAnswer value

ComplexUrlDirectAnswer

A direct answer for a complex url field.

ConjunctionStaticFilter

A static filter composed by combining other static filters with the logical AND operator.

DayHour

An interface for a day's hours to use in BaseFieldValueDirectAnswer.value.

DecimalDirectAnswer

A direct answer for a decimal field, which is a number represented using a string.

DirectAnswer

A direct answer to a search.

DirectAnswerState

Maintains the direct answer associated with the latest search.

DisjunctionStaticFilter

A static filter composed by combining filters with the logical OR operator. The combined filters can either be field value filters or other disjunction filters.

DisplayableFacet

A Facet which contains extra fields meant to be displayed to the end user.

DisplayableFacetOption

A FacetOption with extra data meant to be displayed to the end user.

DocumentResult

Details about the document and the document search algorithm

EmailDirectAnswer

A BaseFieldValueDirectAnswer interface with 'email' field type.

Endpoints

Overrides for the URLs which are used when making requests to the Search API.

FacebookUrlDirectAnswer

A direct answer for a facebook url field.

Facet

Represents dynamic filter options for the Search API.

FacetOption

A filter associated with the facet.

FailedVertical

Error information from when a vertical fails to return results.

FieldValueFilter

Represents a filter which compares values to a single field.

FieldValueStaticFilter

A FieldValueFilter with the kind of filter specified to discriminate between static filter types.

FilterSearchRequest

Options for a filtersearch request.

FilterSearchResponse

The response of a filtersearch request.

FiltersState

Maintains the current state of facets and filters in the application.

GenerativeDirectAnswerRequest

Options which can be specified for a generative direct answer request.

GenerativeDirectAnswerResponse

A representation of a generative direct answer response.

GenerativeDirectAnswerService

A service for generative direct answer requests.

GenerativeDirectAnswerState

Maintains the data for the latest generative direct answer.

HighlightedValue

A field value and its substring matches as emphasized by the Search API.

HolidayHours

An interface for holiday hours to use in BaseFieldValueDirectAnswer.value.

Hours

An interface for hours fields to use in BaseFieldValueDirectAnswer.value.

HoursDirectAnswer

A BaseFieldValueDirectAnswer interface with 'hours' field type.

HTMLSnippetDirectAnswer

A BaseFeaturedSnippetDirectAnswer with 'html' field type. "value" field is omitted for featured snippet direct answer of this field type.

InstagramHandleDirectAnswer

A direct answer for an instagram handle field.

IntegerDirectAnswer

A direct answer for an integer field.

Interval

An interface for a time interval to use in BaseFieldValueDirectAnswer.value.

IosAppUrlDirectAnswer

A direct answer for an iOS app url field.

LatLong

The latitude and longitude of the user making the request. Used to bias the results.

LocationBias

Information about the user's location.

LocationBoundingBox

Location boundaries for a filter with "Place" for its AppliedQueryFilterType. (e.g. boundary for a locality or region specific location filter)

LocationFilterDetails

Additional details relevant to the filter with "PLACE" for its AppliedQueryFilterType.

LocationState

Maintains the user's location, if given, or the inferred location, that is used to bias search results.

LowerNumberRangeLimit

The start limit of NumberRangeValue.

MarkdownSnippetDirectAnswer

A BaseFeaturedSnippetDirectAnswer with 'markdown' field type. "value" field is omitted for featured snippet direct answer of this field type.

MetaState

Maintains the metadata for Search Headless.

MultiLineTextSnippetDirectAnswer

A BaseFeaturedSnippetDirectAnswer with 'multi_line_text' field type.

NearFilterValue

A filter value for a filter with a $near Matcher.

NumberRangeValue

A filter value for a filter with a $between Matcher.

ParentState

The overall shape of the redux state tree, with each key value pair of headlessId to State representing a single SearchHeadless instance.

PhoneDirectAnswer

A BaseFieldValueDirectAnswer interface with phone value.

QueryRulesActionsData

Data returned from the Search query rules system.

QueryRulesState

Maintains the data from the triggered query rules.

QueryState

Maintains the latest query and its associated data.

QuestionSubmissionRequest

Options for a QuestionSubmission request.

QuestionSubmissionResponse

A representation of a question submission response.

QuestionSubmissionService

Submits a custom question to the Search API.

RangeBoundary

A boundary for a BoundedRange of type T.

Result

An individual search result.

RichTextDirectAnswer

A direct answer for a rich text field.

RichTextSnippetDirectAnswer

A BaseFeaturedSnippetDirectAnswer with 'rich_text' field type. "value" field is omitted for featured snippet direct answer of this field type.

RichTextV2SnippetDirectAnswer

A BaseFeaturedSnippetDirectAnswer with 'rich_text_v2' field type. "value" field is omitted for featured snippet direct answer of this field type.

SearchConfigWithApiKey

Configuration options for SearchCore, which includes the options from BaseSearchConfig, but requires apiKey.

SearchConfigWithToken

Configuration options for SearchCore, which includes the options from BaseSearchConfig, but requires token.

SearchParameterField

Indicates which entity field to perform the autocomplete request on.

SearchRequest

Options for a Search API request.

SearchService

A service which performs Yext Search.

SearchStatusState

Maintains the status of the latest search.

Segment

A result produced by a document vertical.

SelectableStaticFilter

A StaticFilter with additional information, such as an optional display name and whether or not it is selected.

ServingConfig

The configuration options for getting the endpoints.

SessionTrackingState

Maintains whether the user session should be tracked and, if so, the session information.

Snippet

The section of text where a FeaturedSnippetDirectAnswer was found.

SortBy

Represents a criterion that can be used to sort results.

SpellCheck

A spellcheck response from a search query.

SpellCheckState

Maintains whether spellcheck is enabled and the spellcheck response from the latest search.

State

The state representing a SearchHeadless instance.

StateListener

Represents a listener for a specific value of type T in the state.

StateManager

Manages the information contained in the state for a SearchHeadless instance.

TextDirectAnswer

A direct answer whose source is a string or string list field in the knowledge graph.

TwitterHandleDirectAnswer

A direct answer for an twitter handle field.

UniversalAutocompleteRequest

Options for a universal autocomplete request.

UniversalLimit

The maximum limit of results per vertical. Each limit can be set from 1-50, inclusive.

UniversalSearchRequest

Options which can be specified for a universal search.

UniversalSearchResponse

A representation of a response from a universal search.

UniversalSearchState

Maintains the data for the latest universal search.

UnknownFieldValueDirectAnswer

A BaseFieldValueDirectAnswer with a field type outside of BuiltInFieldType.

UpperNumberRangeLimit

The end limit of NumberRangeValue.

UrlDirectAnswer

A direct answer for a simple url field.

VerticalAutocompleteRequest

Options for a vertial autocomplete request.

VerticalResults

Represents results from a search vertical.

VerticalSearchRequest

Options which can be specified for a vertical search.

VerticalSearchResponse

A representation of a response from a vertical search.

VerticalSearchState

Maintains the data for the latest vertical search.

Visitor

Information used to associate requests with a particular user.

Namespaces

Namespace

Description

searchUtilities

Variables

Variable

Description

DEFAULT_HEADLESS_ID

The headlessId automatically given to the first SearchHeadless instance created.

SandboxEndpoints

The endpoints to use for sandbox experiences.

Type Aliases

Type Alias

Description

Context

Used to trigger Search Query Rules.

EnumOrLiteral

Produces a union type from the enum passed as a generic which consists of the enum values and the string literals of the enum.

FeaturedSnippetDirectAnswer

All possible built-in BaseFeaturedSnippetDirectAnswer interfaces.

FieldValueDirectAnswer

Possible built-in and custom BaseFieldValueDirectAnswer interfaces.

HeadlessConfig

The configuration for a SearchHeadless instance.

HighlightedFields

A mapping of fields to the values emphasized by the Search API.

SearchConfig

The main configuration options for SearchCore. For a full description of the options, see BaseSearchConfig. The config requires either an apiKey or a token.

SearchType

An enum and its corresponding string literals which indicate the type of search that Headless is managing.

StaticFilter

Represents a static filter that will be used to refine results.