Creates a new GraphQLSearchClient instance.
The GraphQL data provider to use for queries
Execute a full knowledge search with optional filters and scoring controls.
This method invokes the SearchKnowledge GraphQL mutation on the server and returns ranked results from multiple source types (vector, full-text, entity, storage).
The search parameters including query, filters, and scoring options
A Promise that resolves to a SearchClientResponse with ranked results
const result = await searchClient.ExecuteSearch({
Query: "customer satisfaction trends",
MaxResults: 25,
MinScore: 0.3,
Filters: {
EntityNames: ["Surveys", "Reports"],
Tags: ["Q4", "customer-feedback"]
}
});
if (result.Success) {
console.log(`Source breakdown: Vector=${result.SourceCounts.Vector}, FullText=${result.SourceCounts.FullText}`);
}
Query the list of MJ: Search Scopes the current user can see and use.
Populates the scope selector in the UI. Returns an empty array on any failure.
Execute a lightweight preview search with fewer fields returned.
This method invokes the PreviewSearch GraphQL mutation, which returns a smaller payload suitable for autocomplete, type-ahead, or quick-lookup scenarios.
The search query text
OptionalmaxResults: numberOptional maximum number of results (defaults to server-side default)
A Promise that resolves to a SearchClientResponse with preview results
Phase 2C streaming search. Two-step protocol matching the resolver:
{ Success, StreamID } and starts the search in the background.SearchStreamEvents(streamID). Events arrive over
the existing WebSocket subscription transport until a 'final' or
'error' phase, after which the caller should unsubscribe.Returns an Observable that emits SearchStreamNotification objects. The first emission is always the mutation acknowledgement (with Phase='start' and the StreamID); subsequent emissions are the server-pushed events. Callers should:
Phase === 'final' for the canonical result setPhase === 'error' to surface failures to the user.unsubscribe() after the terminal event
Client for executing universal search operations through GraphQL. This class provides an easy way to search across knowledge sources from a client application, including vector search, full-text search, entity search, and file storage search.
The GraphQLSearchClient follows the same naming convention as other GraphQL clients in the MemberJunction ecosystem, such as GraphQLActionClient and GraphQLAIClient.
Example