Search
Perform reverse search on a percolate table
Performs a percolate search. This method must be used only on percolate tables. Expects two parameters: the table name and an object with array of documents to be tested. An example of the documents object: ``` { "query" { "percolate": { "document": { "content":"sample content" } } } }
Responds with an object with matched stored queries: ```
{
'timed_out':false,
'hits': {
'total':2,
'max_score':1,
'hits': [
{
'table':'idx_pq_1',
'_type':'doc',
'_id':'2',
'_score':'1',
'_source': {
'query': {
'match':{'title':'some'}
}
}
},
{
'table':'idx_pq_1',
'_type':'doc',
'_id':'5',
'_score':'1',
'_source': {
'query': {
'ql':'some | none'
}
}
}
]
}
}
post/pq/{table}/search
Path parameters
tablestring required
Name of the percolate table
Request body
Example request
{
"query": {
"percolate": {
"document": {
"title": "some text to match"
}
}
}
}Response
items found
Example response
{
"hits": {
"total": 2,
"hits": [
{
"_id": 1,
"_score": 1,
"_source": {
"gid": 11
}
},
{
"_id": 2,
"_score": 1,
"_source": {
"gid": 20
}
}
]
},
"took": 0,
"user_query": "What is vector search?",
"sources": "[{\"id\":1,\"title\":\"Vector Search\",\"content\":\"...\",\"knn_dist\":0.12}]",
"response": "Vector search finds similar items by comparing embeddings...",
"profile": "{}",
"scroll": "scroll",
"warning": "{}",
"timed_out": true,
"search_query": "vector search, embeddings, similarity search",
"aggregations": {
"sizes": {
"buckets": [
{
"key": "small",
"doc_count": 1,
"status": "selected"
},
{
"key": "large",
"doc_count": 1,
"status": "available"
}
]
},
"colors": {
"buckets": [
{
"key": 10,
"doc_count": 1019
},
{
"key": 9,
"doc_count": 954,
"status": "unavailable"
}
]
}
},
"conversation_uuid": "docs-chat-001"
}