Skip to main content

Query Intent Service

Overview

The QueryIntentService is responsible for analyzing queries to identify their intent. It maintains a cache to prevent analyzing the same query multiple times.

getQueryIntent()

Retrieves query intent matches for a given query.

getQueryIntent(query: Query): Observable<QueryIntentMatch[]>
ParameterTypeDescription
queryQueryThe query to analyze for intent.

Returns

Observable<QueryIntentMatch[]> - An observable that emits an array of query intent matches.

Usage Example:

queryIntentService.getQueryIntent(query).subscribe(intents => {
console.log(intents);
});

The service maintains an internal cache to prevent analyzing the same query text multiple times. If the query text is empty, an empty array will be returned immediately.