NAME

Twilio::Rest::Knowledge::V2::Search - The Search resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $search = $client->knowledge->v2->search($kb_id)->create(\%body);

DESCRIPTION

This file holds SearchList and SearchInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

SearchList

Returned by $client->knowledge->v2->search($kb_id). See also Twilio::ListResource.

create

my $search = $client->knowledge->v2->search($kb_id)->create(\%body);

Perform semantic search across knowledge sources within a knowledge base to find the most relevant content chunks based on a natural language query. Returns ranked chunks with similarity scores, allowing you to retrieve contextually relevant information for AI applications, chatbots, or information retrieval systems. You can filter results by specific knowledge sources. Returns a SearchInstance.

%body is sent as JSON. It can be left out. When given, it takes the names Twilio's API documentation uses.

Its fields are:

knowledgeIds

The list of knowledge IDs to search.

query

Required. The query to search the knowledge source.

top

Required. The top K results to return.

SearchInstance

See also Twilio::InstanceResource.

Its fields are:

chunks

No description in the specification.

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.