openapi: 3.1.0 info: contact: email: info@manticoresearch.com name: Manticore Software Ltd. url: https://manticoresearch.com/contact-us/ description: | Сlient for Manticore Search. license: name: MIT url: http://opensource.org/licenses/MIT title: Manticore Search Client version: 5.0.0 externalDocs: description: Find out more about Manticore Search url: https://manticoresearch.com/ servers: - description: Default Manticore Search HTTP url: http://127.0.0.1:9308/ security: - {} - basicAuth: [] - bearerAuth: [] tags: - description: "Operations regarding adding, updating or deleting documents" name: Index - description: Operations about performing searches over tables name: Search - description: Various operations name: Utils paths: /search: post: description: |2 The method expects an object with the following mandatory properties: * the name of the table to search * the match query object For details, see the documentation on [**SearchRequest**](SearchRequest.md) The method returns an object with the following properties: - took: the time taken to execute the search query. - timed_out: a boolean indicating whether the query timed out. - hits: an object with the following properties: - total: the total number of hits found. - hits: an array of hit objects, where each hit object represents a matched document. Each hit object has the following properties: - _id: the ID of the matched document. - _score: the score of the matched document. - _source: the source data of the matched document. In addition, if profiling is enabled, the response will include an additional array with profiling information attached. Also, if pagination is enabled, the response will include an additional 'scroll' property with a scroll token to use for pagination Here is an example search response: ``` { 'took':10, 'timed_out':false, 'hits': { 'total':2, 'hits': [ {'_id':'1','_score':1,'_source':{'gid':11}}, {'_id':'2','_score':1,'_source':{'gid':12}} ] } } ``` For conversational search, include a `chat` object instead of `table` and `query`. The response then includes the optional conversational fields on `searchResponse` (`conversation_uuid`, `user_query`, `search_query`, `response`, `sources`). For more information about the match query syntax and additional parameters that can be added to request and response, please see the documentation [here](https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#HTTP-JSON). externalDocs: url: https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#HTTP-JSON operationId: search requestBody: content: application/json: example: - "'request=SearchRequest(table=\"test\",query=Query(query_string=\"abc\"\ ))'" schema: $ref: "#/components/schemas/searchRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/searchResponse" description: | Ok. Returns `searchResponse`. For conversational search requests that include a `chat` object, the optional conversational fields are also set. default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Performs a search on a table tags: - Search x-is_search: true /autocomplete: post: description: "\nThe method expects an object with the following mandatory properties:\n\ * the name of the table to search\n* the query string to autocomplete\nFor\ \ details, see the documentation on [**Autocomplete**](Autocomplete.md)\n\ An example: ``` {\n \"table\":\"table_name\",\n \"query\":\"query_beginning\"\ \n} ```\nAn example of the method's response:\n\n ```\n [\n {\n\ \ \"total\": 3,\n \"error\": \"\",\n \"warning\": \"\",\n \ \ \"columns\": [\n {\n \"query\": {\n \"type\": \"\ string\"\n }\n }\n ],\n \"data\": [\n {\n \ \ \"query\": \"hello\"\n },\n {\n \"query\": \"helio\"\ \n },\n {\n \"query\": \"hell\"\n }\n ]\n \ \ }\n ] \n ```\n\nFor more detailed information about the autocomplete queries,\ \ please refer to the documentation [here](https://manual.manticoresearch.com/Searching/Autocomplete).\n" externalDocs: url: https://manual.manticoresearch.com/dev/Searching/Autocomplete?client=JSON operationId: autocomplete requestBody: content: application/json: example: - "'request=AutocompleteRequest(table=\"test\",query=\"abc\")'" schema: $ref: "#/components/schemas/autocompleteRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/sqlRawResponse" description: Ok default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Performs an autocomplete search on a table tags: - Search /bulk: post: description: "Sends multiple operatons like inserts, updates, replaces or deletes.\ \ \nFor each operation it's object must have same format as in their dedicated\ \ method. \nThe method expects a raw string as the batch in NDJSON.\n Each\ \ operation object needs to be serialized to \n JSON and separated by endline\ \ (\\n). \n \n An example of raw input:\n \n ```\n {\"insert\": {\"table\"\ : \"movies\", \"doc\": {\"plot\": \"A secret team goes to North Pole\", \"\ rating\": 9.5, \"language\": [2, 3], \"title\": \"This is an older movie\"\ , \"lon\": 51.99, \"meta\": {\"keywords\":[\"travel\",\"ice\"],\"genre\":[\"\ adventure\"]}, \"year\": 1950, \"lat\": 60.4, \"advise\": \"PG-13\"}}}\n \ \ \\n\n {\"delete\": {\"table\": \"movies\",\"id\":700}}\n ```\n \n Responds\ \ with an object telling whenever any errors occured and an array with status\ \ for each operation:\n \n ```\n {\n 'items':\n [\n {\n \ \ 'update':{'table':'products','id':1,'result':'updated'}\n },\n \ \ {\n 'update':{'table':'products','id':2,'result':'updated'}\n\ \ }\n ],\n 'errors':false\n }\n ```\n" externalDocs: url: https://manual.manticoresearch.com/Updating_documents/UPDATE operationId: bulk requestBody: content: application/x-ndjson: schema: type: string required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/bulkResponse" description: item updated default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Bulk table operations tags: - Index /delete: post: description: "Delete one or several documents.\nThe method has 2 ways of deleting:\ \ either by id, in case only one document is deleted or by using a match\ \ query, in which case multiple documents can be delete .\nExample of input\ \ to delete by id:\n\n ```\n {'table':'movies','id':100}\n ```\n\nExample\ \ of input to delete using a query:\n\n ```\n {\n 'table':'movies',\n\ \ 'query':\n {\n 'bool':\n {\n 'must':\n [\n\ \ {'query_string':'new movie'}\n ]\n }\n }\n }\n\ \ ```\n\nThe match query has same syntax as in for searching.\nResponds with\ \ an object telling how many documents got deleted: \n\n ```\n {'table':'products','updated':1}\n\ \ ```\n" externalDocs: url: https://manual.manticoresearch.com/Updating_documents/UPDATE operationId: delete requestBody: content: application/json: example: table: test query: match: title: apple schema: $ref: "#/components/schemas/deleteDocumentRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/deleteResponse" description: item updated default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Delete a document in a table tags: - Index /insert: post: description: "Insert a document. \nExpects an object like:\n \n ```\n {\n\ \ 'table':'movies',\n 'id':701,\n 'doc':\n {\n 'title':'This\ \ is an old movie',\n 'plot':'A secret team goes to North Pole',\n \ \ 'year':1950,\n 'rating':9.5,\n 'lat':60.4,\n 'lon':51.99,\n\ \ 'advise':'PG-13',\n 'meta':'{\"keywords\":{\"travel\",\"ice\"\ },\"genre\":{\"adventure\"}}',\n 'language':[2,3]\n }\n }\n ```\n\ \ \nThe document id can also be missing, in which case an autogenerated one\ \ will be used:\n \n ```\n {\n 'table':'movies',\n 'doc':\n\ \ {\n 'title':'This is a new movie',\n 'plot':'A secret team\ \ goes to North Pole',\n 'year':2020,\n 'rating':9.5,\n 'lat':60.4,\n\ \ 'lon':51.99,\n 'advise':'PG-13',\n 'meta':'{\"keywords\"\ :{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}',\n 'language':[2,3]\n\ \ }\n }\n ```\n \nIt responds with an object in format:\n \n ```\n\ \ {'table':'products','id':701,'created':true,'result':'created','status':201}\n\ \ ```\n" externalDocs: url: https://manual.manticoresearch.com/Adding_documents_to_a_table/Adding_documents_to_a_real-time_table#Adding-documents-to-a-real-time-table operationId: insert requestBody: content: application/json: example: table: test id: 1 doc: title: sample title gid: 10 schema: $ref: "#/components/schemas/insertDocumentRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/successResponse" description: OK default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Create a new document in a table tags: - Index x-is_indexapi: true x-is_insert: true /pq/{table}/search: post: description: | 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' } } } ] } } ``` externalDocs: url: https://manual.manticoresearch.com/Updating_documents/UPDATE operationId: percolate parameters: - description: Name of the percolate table explode: false in: path name: table required: true schema: type: string style: simple requestBody: content: application/json: example: query: percolate: document: title: some text to match schema: $ref: "#/components/schemas/percolateRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/searchResponse" description: items found default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Perform reverse search on a percolate table tags: - Search /replace: post: description: | Replace an existing document. Input has same format as `insert` operation. Responds with an object in format: ``` {'table':'products','id':1,'created':false,'result':'updated','status':200} ``` externalDocs: url: https://manual.manticoresearch.com/Adding_documents_to_a_table/Adding_documents_to_a_real-time_table#Adding-documents-to-a-real-time-table operationId: replace requestBody: content: application/json: example: table: test id: 1 doc: title: updated title gid: 15 schema: $ref: "#/components/schemas/insertDocumentRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/successResponse" description: OK default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Replace new document in a table tags: - Index x-is_indexapi: true x-is_replace: true /sql: post: description: | Run a query in SQL format. Expects a query string passed through `body` parameter and optional `raw_response` parameter that defines a format of response. `raw_response` can be set to `False` for Select queries only, e.g., `SELECT * FROM mytable` The query string must stay as it is, no URL encoding is needed. The response object depends on the query executed. In select mode the response has same format as `/search` operation. externalDocs: url: https://manual.manticoresearch.com/Connecting_to_the_server/HTTP#sql-api operationId: sql parameters: - description: | Optional parameter, defines a format of response. Can be set to `False` for Select only queries and set to `True` for any type of queries. Default value is 'True'. explode: true in: query name: raw_response required: false schema: default: true type: boolean style: form requestBody: content: text/plain: example: SHOW TABLES schema: type: string description: | A query parameter string. required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/sqlResponse" description: | In case of SELECT-only in mode none the response schema is the same as of `search`. In case of `mode=raw` or `raw_response=true` the response depends on the query executed. default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Perform SQL requests tags: - Utils x-is_sql: true /token: post: description: | Create or rotate a bearer token for the authenticated HTTP user. Requires HTTP Basic authentication with a Manticore user name and password. The endpoint returns the raw token. Example: ``` curl -u admin:password -X POST http://127.0.0.1:9308/token -d "{}" ``` externalDocs: url: https://manual.manticoresearch.com/Security/Authentication_and_authorization operationId: token requestBody: content: application/json: example: {} schema: $ref: "#/components/schemas/tokenRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/tokenResponse" text/plain: schema: $ref: "#/components/schemas/tokenResponse" description: Bearer token created or rotated successfully "401": content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: Missing or invalid credentials default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error security: - basicAuth: [] summary: Create or rotate a bearer token tags: - Utils /update: post: description: "Update one or several documents.\nThe update can be made by passing\ \ the id or by using a match query in case multiple documents can be updated.\ \ For example update a document using document id:\n\n ```\n {'table':'movies','doc':{'rating':9.49},'id':100}\n\ \ ```\n\nAnd update by using a match query:\n\n ```\n {\n 'table':'movies',\n\ \ 'doc':{'rating':9.49},\n 'query':\n {\n 'bool':\n {\n\ \ 'must':\n [\n {'query_string':'new movie'}\n \ \ ]\n }\n }\n }\n ``` \n\nThe match query has same syntax as\ \ for searching.\nResponds with an object that tells how many documents where\ \ updated in format: \n\n ```\n {'table':'products','updated':1}\n ```\n" externalDocs: url: https://manual.manticoresearch.com/Updating_documents/UPDATE operationId: update requestBody: content: application/json: example: table: test doc: gid: 20 query: equals: cat_id: 2 schema: $ref: "#/components/schemas/updateDocumentRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/updateResponse" description: item updated default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Update a document in a table tags: - Index x-is_indexapi: true x-is_update: true x-is_modify: true /{table}/_update/{id}: post: description: "Partially replaces a document with given id in a table\nResponds\ \ with an object of the following format: \n\n ```\n {'table':'products','updated':1}\n\ \ ```\n" externalDocs: url: https://manual.manticoresearch.com/Updating_documents/REPLACE#JSON-REPLACE operationId: partial_replace parameters: - description: Name of the percolate table explode: false in: path name: table required: true schema: type: string style: simple - description: Id of the document to replace explode: false in: path name: id required: true schema: format: uint64 type: integer style: simple requestBody: content: application/json: example: doc: price: 20 schema: $ref: "#/components/schemas/replaceDocumentRequest" required: true responses: "200": content: application/json: schema: $ref: "#/components/schemas/updateResponse" description: item updated default: content: application/json: schema: $ref: "#/components/schemas/errorResponse" description: error summary: Partially replaces a document in a table tags: - Index components: examples: objectExample: summary: A sample object value: www schemas: aggCompositeTerm: additionalProperties: false description: Object representing a term to be used in composite aggregation. properties: field: description: Name of field to operate with example: field1 type: string required: - field aggCompositeSource: additionalProperties: false description: Object containing terms used for composite aggregation. properties: terms: $ref: "#/components/schemas/aggCompositeTerm" required: - terms aggHistogram: additionalProperties: false description: "Object to use histograms in aggregation, i.e., grouping search\ \ results by histogram values" properties: field: description: Field to group by example: field type: string interval: description: Interval of the histogram values example: 10 type: integer offset: description: Offset of the histogram values. Default value is 0. example: 1 type: integer keyed: description: Flag that defines if a search response will be a dictionary with the bucket keys. Default value is false. example: true type: boolean required: - field - interval aggDateHistogram: additionalProperties: false description: "Object to use histograms in aggregation, i.e., grouping search\ \ results by histogram values" properties: field: description: Field to group by example: field type: string calendar_interval: description: Interval of the histogram values example: 10 type: integer offset: description: Offset of the histogram values. Default value is 0. example: 1 type: integer keyed: description: Flag that defines if a search response will be a dictionary with the bucket keys. Default value is false. example: true type: boolean required: - calendar_interval - field range: additionalProperties: false description: | An aggregation range. properties: from: {} to: {} aggRange: additionalProperties: false description: | Group documents into custom numeric or date ranges. Use with the `range` or `date_range` aggregation type. properties: field: description: Attribute to group by example: price type: string ranges: description: Ordered list of ranges items: $ref: "#/components/schemas/range" minItems: 1 type: array keyed: description: | Return buckets as an object keyed by range label when true, or as an array when false. Default is false. type: boolean required: - field - ranges aggComposite: additionalProperties: false description: "Object to perform composite aggregation, i.e., grouping search\ \ results by multiple fields" properties: size: description: Maximum number of composite buckets in the result example: 1000 type: integer sources: items: additionalProperties: $ref: "#/components/schemas/aggCompositeSource" description: List of objects that contain terms used for composite aggregation. type: array aggTerms: additionalProperties: false description: Object containing term fields to aggregate on properties: field: description: Name of attribute to aggregate by example: field1 type: string size: description: Maximum number of buckets in the result example: 1000 type: integer required: - field aggTDigest: additionalProperties: false description: T-Digest settings for approximate statistical aggregations properties: compression: description: Accuracy/memory trade-off. Default is 200. example: 200 type: number aggPercentiles: additionalProperties: false description: | Object to use percentile values in aggregation. For more information see [Grouping](https://manual.manticoresearch.com/Searching/Grouping#PERCENTILES(),-PERCENTILE_RANKS(),-MEDIAN_ABSOLUTE_DEVIATION()) properties: field: description: Numeric field to calculate percentiles for example: latency type: string values: description: | Percentile points to compute (0-100). Defaults to 1, 5, 25, 50, 75, 95, and 99 when omitted. example: - 5 - 50 - 95 items: type: number type: array keyed: description: | Return an object keyed by percentile when true, or an array when false. Default is false. type: boolean tdigest: $ref: "#/components/schemas/aggTDigest" required: - field aggPercentileRanks: additionalProperties: false description: | Object to use percentile ranks in aggregation. For more information see [Grouping](https://manual.manticoresearch.com/Searching/Grouping#PERCENTILE_RANKS(),-MEDIAN_ABSOLUTE_DEVIATION()) properties: field: description: Numeric field to calculate percentile ranks for example: latency type: string values: description: Input values to rank example: - 10 - 150 - 1500 items: type: number type: array keyed: description: | Return an object keyed by input value when true, or an array when false. Default is false. type: boolean tdigest: $ref: "#/components/schemas/aggTDigest" required: - field - values aggMedianAbsoluteDeviation: additionalProperties: false description: | Object to use median absolute deviation in aggregation. For more information see [Grouping](https://manual.manticoresearch.com/Searching/Grouping#PERCENTILES(),-PERCENTILE_RANKS(),-MEDIAN_ABSOLUTE_DEVIATION()) properties: field: description: Numeric field to calculate MAD for example: latency type: string tdigest: $ref: "#/components/schemas/aggTDigest" required: - field aggMetric: additionalProperties: false description: Metric aggregation over a numeric field properties: field: description: Numeric field to aggregate example: rental_rate type: string required: - field aggregation: allOf: - description: Object used for grouping search results properties: terms: $ref: "#/components/schemas/aggTerms" sort: items: type: object type: array composite: $ref: "#/components/schemas/aggComposite" histogram: $ref: "#/components/schemas/aggHistogram" date_histogram: $ref: "#/components/schemas/aggDateHistogram" range: $ref: "#/components/schemas/aggRange" date_range: $ref: "#/components/schemas/aggRange" percentiles: $ref: "#/components/schemas/aggPercentiles" percentile_ranks: $ref: "#/components/schemas/aggPercentileRanks" median_absolute_deviation: $ref: "#/components/schemas/aggMedianAbsoluteDeviation" min: $ref: "#/components/schemas/aggMetric" max: $ref: "#/components/schemas/aggMetric" sum: $ref: "#/components/schemas/aggMetric" avg: $ref: "#/components/schemas/aggMetric" knn: description: Object representing a k-nearest neighbor search query properties: field: description: Field to perform the k-nearest neighbor search on type: string k: description: The number of nearest neighbors to return type: integer query: $ref: "#/components/schemas/knn_query" query_vector: description: The vector used as input for the KNN search items: type: number type: array doc_id: description: The docuemnt ID used as input for the KNN search format: uint64 type: integer ef: description: Optional parameter controlling the accuracy of the search type: integer rescore: description: Optional parameter enabling KNN rescoring (disabled by default) type: boolean oversampling: description: Optional parameter setting a factor by which k is multiplied when executing the KNN search type: number filter: $ref: "#/components/schemas/queryFilter" required: - field - k geoDistance: additionalProperties: {} description: Object to perform geo-distance based filtering on queries properties: location_anchor: $ref: "#/components/schemas/geoDistance_location_anchor" location_source: description: Field name in the document that contains location data type: string distance_type: description: Algorithm used to calculate the distance enum: - adaptive - haversine type: string distance: description: The distance from the anchor point to filter results by pattern: /^\.+(km|m|cm|mm|mi|yd|ft|in|NM|nmi|kilometers|meters|centimeters|millimeters|miles|yards|foots|inches|nauticalmiles|)$/ type: string searchQuery: allOf: - $ref: "#/components/schemas/queryFilter" - additionalProperties: false properties: highlight: $ref: "#/components/schemas/highlight" description: Defines a query structure for performing search operations chat: additionalProperties: false description: | Conversational search request handled by Manticore Buddy via `CALL CHAT`. When this object is set, the `/search` endpoint answers through an LLM using KNN-retrieved rows as context instead of returning regular search hits. Required fields are `query`, `table`, and `model_name`. Chat model management (`CREATE CHAT MODEL`, etc.) remains SQL-only. For more information see [Conversational search](https://manual.manticoresearch.com/Searching/Conversational_search#HTTP-JSON-syntax) example: query: What is vector search? table: docs model_name: assistant conversation_uuid: docs-chat-001 vector_field: embedding properties: query: description: User question to send to the chat model example: What is vector search? type: string table: description: Vectorized table to retrieve context from example: docs type: string model_name: description: Name of the chat model example: assistant type: string conversation_uuid: description: | Existing conversation id to continue the dialog, or an empty string to start a new conversation. If omitted, a new id is generated. example: docs-chat-001 type: string vector_field: description: | A specific vector field to search by. If omitted, Buddy uses the first `FLOAT_VECTOR` field from `SHOW CREATE TABLE`. example: title_embedding type: string fields: description: | Legacy alias for `vector_field`. A request must not include both `vector_field` and `fields`. type: string required: - model_name - query - table hybrid: additionalProperties: false description: | Perform hybrid search on tables with auto-embeddings. Runs full-text and vector search and fuses results with RRF. For more information see [Hybrid search](https://manual.manticoresearch.com/Searching/Hybrid_search#Simplified-JSON-syntax:-hybrid) example: query: machine learning field: vec properties: query: description: Search query string example: machine learning type: string field: description: | Vector field name. example: vec type: string required: - query scriptFieldScript: additionalProperties: false description: Inline script used to compute a search expression properties: inline: description: Expression to compute (same syntax as SQL expressions) type: string required: - inline scriptField: additionalProperties: false description: Named expression computed at search time properties: script: $ref: "#/components/schemas/scriptFieldScript" required: - script facetFilterMode: description: | Controls how facets inherit attribute filters from the main query. [Faceted search](https://manual.manticoresearch.com/Searching/Faceted_search#HTTP-JSON) enum: - strict - auto - max type: string searchRequest: description: | Request object for search operation. Either `table` (regular search) or `chat` (conversational search) must be provided. example: table: your_table query: query_string: your_query properties: table: description: The table to perform the search on type: string chat: $ref: "#/components/schemas/chat" query: $ref: "#/components/schemas/searchQuery" join: description: Join clause to combine search data from multiple tables items: $ref: "#/components/schemas/join" type: array highlight: $ref: "#/components/schemas/highlight" limit: description: Maximum number of results to return type: integer knn: $ref: "#/components/schemas/knn" hybrid: $ref: "#/components/schemas/hybrid" facet_filter_mode: $ref: "#/components/schemas/facetFilterMode" aggs: additionalProperties: $ref: "#/components/schemas/aggregation" description: Defines aggregation settings for grouping results example: agg1: terms: field: field1 size: 1000 sort: - field1: null order: asc expressions: additionalProperties: type: string description: | Expressions to calculate additional values for the result. Simpler alternative to `script_fields`; expression names must be lowercase. example: title_len: crc32(title) script_fields: additionalProperties: $ref: "#/components/schemas/scriptField" description: | Named expressions computed at search time. Each value defines an inline script whose result is stored under the field name. For more information see [Expressions](https://manual.manticoresearch.com/Searching/Expressions#script_fields) example: add_all: script: inline: ( gid * 10 ) | crc32(title) title_len: script: inline: crc32(title) max_matches: description: Maximum number of matches allowed in the result type: integer offset: description: Starting point for pagination of the result type: integer options: description: Additional search options type: object profile: description: Enable or disable profiling of the search request type: boolean sort: description: Sorting criteria for the search results type: object _source: description: Specify which fields to include or exclude in the response type: object track_scores: description: Enable or disable result weight calculation used for sorting type: boolean queryFilterAlias1: $ref: "#/components/schemas/queryFilter" queryFilterAlias2: $ref: "#/components/schemas/queryFilter" autocompleteRequest: description: Object containing the data for performing an autocomplete search. example: table: test query: Start options: layouts: "us,uk" fuzziness: 0 properties: table: description: The table to perform the search on type: string query: description: The beginning of the string to autocomplete type: string options: additionalProperties: false description: | Autocomplete options - layouts: A comma-separated string of keyboard layout codes to validate and check for spell correction. Available options - us, ru, ua, se, pt, no, it, gr, uk, fr, es, dk, de, ch, br, bg, be. By default, all are enabled. - fuzziness: (0,1 or 2) Maximum Levenshtein distance for finding typos. Set to 0 to disable fuzzy matching. Default is 2 - prepend: true/false If true, adds an asterisk before the last word for prefix expansion (e.g., *word ) - append: true/false If true, adds an asterisk after the last word for prefix expansion (e.g., word* ) - expansion_len: Number of characters to expand in the last word. Default is 10. type: object required: - query - table boolFilter: additionalProperties: false properties: must: description: Query clauses that must match for the document to be included items: $ref: "#/components/schemas/queryFilter" type: array must_not: description: Query clauses that must not match for the document to be included items: $ref: "#/components/schemas/queryFilterAlias1" type: array should: description: "Query clauses that should be matched, but are not required" items: $ref: "#/components/schemas/queryFilterAlias2" type: array bulkResponse: description: Success response for bulk search requests example: current_line: 0 skipped_lines: 6 error: error items: - "{}" - "{}" errors: true properties: items: description: List of results items: type: object type: array errors: description: Errors occurred during the bulk operation type: boolean error: description: Error message describing an error if such occurred type: string current_line: description: Number of the row returned in the response type: integer skipped_lines: description: Number of rows skipped in the response type: integer deleteDocumentRequest: description: | Payload for delete request. Documents can be deleted either one by one by specifying the document id or by providing a query object. For more information see [Delete API](https://manual.manticoresearch.com/Deleting_documents) example: table: test id: 1 properties: table: description: Table name type: string cluster: description: Cluster name type: string id: description: The ID of document for deletion format: uint64 type: integer query: description: Defines the criteria to match documents for deletion type: object required: - table deleteResponse: description: Response object for successful delete request example: table: test deleted: 29 properties: table: description: The name of the table from which the document was deleted type: string deleted: description: Number of documents deleted type: integer id: description: "The ID of the deleted document. If multiple documents are\ \ deleted, the ID of the first deleted document is returned" format: uint64 type: integer found: description: Indicates whether any documents to be deleted were found type: boolean result: description: "Result of the delete operation, typically 'deleted'" type: string highlight: allOf: - description: Defines a query HIGHLIGHT expression to emphasize matched results properties: after_match: default: description: "Text inserted after the matched term, typically used for\ \ HTML formatting" type: string allow_empty: description: "Permits an empty string to be returned as the highlighting\ \ result. Otherwise, the beginning of the original text would be returned" type: boolean around: description: Number of words around the match to include in the highlight type: integer before_match: default: description: "Text inserted before the match, typically used for HTML\ \ formatting" type: string emit_zones: description: Emits an HTML tag with the enclosing zone name before each highlighted snippet type: boolean encoder: description: "If set to 'html', retains HTML markup when highlighting" enum: - default - html type: string fields: $ref: "#/components/schemas/highlightFields" force_all_words: description: Ignores the length limit until the result includes all keywords type: boolean force_snippets: description: Forces snippet generation even if limits allow highlighting the entire text type: boolean highlight_query: $ref: "#/components/schemas/queryFilter" html_strip_mode: description: Defines the mode for handling HTML markup in the highlight enum: - none - strip - index - retain type: string limits_per_field: description: "Determines whether the 'limit', 'limit_words', and 'limit_snippets'\ \ options operate as individual limits in each field of the document" type: boolean no_match_size: description: "If set to 1, allows an empty string to be returned as a\ \ highlighting result" enum: - 0 - 1 type: integer order: description: Sets the sorting order of highlighted snippets enum: - asc - desc - score type: string pre_tags: default: description: Text inserted before each highlighted snippet type: string post_tags: default: description: Text inserted after each highlighted snippet type: string start_snippet_id: description: Sets the starting value of the %SNIPPET_ID% macro type: integer use_boundaries: description: Defines whether to additionally break snippets by phrase boundary characters type: boolean - $ref: "#/components/schemas/highlightFieldOption" highlightFields: description: List of fields available for highlighting oneOf: - items: type: string type: array - type: object highlightFieldOption: additionalProperties: false description: Options for controlling the behavior of highlighting on a per-field basis properties: fragment_size: description: Maximum size of the text fragments in highlighted snippets per field type: integer limit: description: Maximum size of snippets per field type: integer limit_snippets: description: Maximum number of snippets per field type: integer limit_words: description: Maximum number of words per field type: integer number_of_fragments: description: Total number of highlighted fragments per field type: integer hitsHits: additionalProperties: false description: Search hit representing a matched document properties: _id: description: The ID of the matched document format: uint64 type: integer _score: description: The score of the matched document type: integer _source: description: The source data of the matched document type: object _knn_dist: description: The knn distance of the matched document returned for knn queries type: number highlight: description: The highlighting-related data of the matched document type: object table: description: The table name of the matched document returned for percolate queries type: string '_type:': description: The type of the matched document returned for percolate queries type: string fields: description: The percolate-related fields of the matched document returned for percolate queries type: object insertDocumentRequest: description: | Object containing data for inserting a new document into the table example: table: test doc: title: This is some title gid: 100 properties: table: description: Name of the table to insert the document into type: string cluster: description: Name of the cluster to insert the document into type: string id: description: | Document ID. If not provided, an ID will be auto-generated format: uint64 type: integer doc: additionalProperties: false description: | Object containing document data type: object required: - doc - table joinOn: allOf: - additionalProperties: false properties: right: $ref: "#/components/schemas/joinCond" - additionalProperties: false properties: left: $ref: "#/components/schemas/joinCond" - additionalProperties: false description: Defines joined tables properties: operator: enum: - eq type: string join: allOf: - additionalProperties: false description: Object representing the join operation between two tables properties: type: description: Type of the join operation enum: - inner - left type: string "on": description: List of objects defining joined tables items: $ref: "#/components/schemas/joinOn" type: array query: $ref: "#/components/schemas/fulltextFilter" table: description: Basic table of the join operation type: string required: - "on" - table - type joinCond: additionalProperties: false description: Object representing the conditions used to perform the join operation properties: field: description: Field to join on type: string table: description: Joined table type: string query: $ref: "#/components/schemas/fulltextFilter" type: type: object required: - field - table _match: description: Filter helper object defining a match keyword and match options properties: query: type: string operator: enum: - or - and type: string boost: type: number required: - query match_all: description: Filter helper object defining the 'match all'' condition properties: _all: enum: - "{}" type: string required: - _all rangeFilter: description: Filter helper object defining the 'range' condition properties: lt: description: condition value type: object lte: description: condition value type: object gt: description: condition value type: object gte: description: condition value type: object fulltextFilter: additionalProperties: false description: Defines a type of filter for full-text search queries properties: query_string: description: Filter object defining a query string type: string match: description: Filter object defining a match keyword passed as a string or in a Match object type: object match_phrase: description: Filter object defining a match phrase type: object match_all: description: Filter object to select all documents type: object queryFilter: allOf: - $ref: "#/components/schemas/fulltextFilter" - additionalProperties: false properties: bool: $ref: "#/components/schemas/boolFilter" equals: $ref: "#/components/schemas/queryFilter_allOf_equals" in: $ref: "#/components/schemas/queryFilter_allOf_in" range: $ref: "#/components/schemas/queryFilter_allOf_range" geo_distance: $ref: "#/components/schemas/geoDistance" description: "Object used to apply various conditions, such as full-text matching\ \ or attribute filtering, to a search query" replaceDocumentRequest: description: Object containing the document data for replacing an existing document in a table. example: doc: title: This is some title gid: 100 properties: doc: additionalProperties: false description: Object containing the new document data to replace the existing one. type: object required: - doc sourceRules: additionalProperties: {} description: Defines which fields to include or exclude in the response for a search query example: includes: - attr1 - attri* excludes: - desc* minProperties: 1 properties: includes: default: [] description: List of fields to include in the response items: type: string type: array excludes: default: - "" description: List of fields to exclude from the response items: type: string type: array successResponse: description: "Response object indicating the success of an operation, such as\ \ inserting or updating a document" example: table: test id: 1 result: created created: true status: 201 properties: table: description: Name of the document table type: string id: description: ID of the document affected by the request operation format: uint64 type: integer created: description: Indicates whether the document was created as a result of the operation type: boolean result: description: "Result of the operation, typically 'created', 'updated', or\ \ 'deleted'" type: string found: description: Indicates whether the document was found in the table type: boolean status: description: HTTP status code representing the result of the operation type: integer percolateRequest: description: Object containing the query for percolating documents against stored queries in a percolate table properties: query: $ref: "#/components/schemas/percolateRequest_query" required: - query facetBucketStatus: description: | Facet bucket availability marker returned when `facet_filter_mode` is `auto` or `max`. `selected` means the bucket value is already present in a same-facet value filter. `available` means selecting the bucket can produce results. `unavailable` means the bucket exists in the broad max count scope but selecting it would produce no results. enum: - selected - available - unavailable type: string aggBucket: additionalProperties: {} description: Single bucket in an aggregation result properties: key: {} doc_count: description: Number of documents in the bucket type: integer status: $ref: "#/components/schemas/facetBucketStatus" required: - doc_count aggBucketsResult: additionalProperties: {} description: Aggregation group returned under `aggregations` properties: buckets: {} after_key: additionalProperties: false description: Pagination cursor returned by composite aggregations type: object searchResponse: description: | Response object containing search results. For conversational search requests that include a `chat` object, the optional chat fields below are also populated. For conversational search response fields see [Conversational search](https://manual.manticoresearch.com/Searching/Conversational_search#Response) example: 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 properties: took: description: Time taken to execute the search type: integer timed_out: description: Indicates whether the search operation timed out type: boolean aggregations: additionalProperties: $ref: "#/components/schemas/aggBucketsResult" description: | Aggregated search results grouped by the specified criteria. Each named aggregation typically contains a `buckets` array (or keyed map) of bucket objects with `key`, `doc_count`, and optional `status`. example: 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 hits: $ref: "#/components/schemas/searchResponse_hits" profile: description: "Profile information about the search execution, if profiling\ \ is enabled" type: object scroll: description: Scroll token to be used fo pagination type: string warning: additionalProperties: false description: Warnings encountered during the search operation type: object conversation_uuid: description: Existing or generated conversation id (conversational search) example: docs-chat-001 type: string user_query: description: Original user query (conversational search) example: What is vector search? type: string search_query: description: Standalone search query used for KNN retrieval (conversational search) example: "vector search, embeddings, similarity search" type: string response: description: LLM answer as generated (conversational search) example: Vector search finds similar items by comparing embeddings... type: string sources: description: | JSON string containing retrieved source rows used as LLM context (conversational search). example: "[{\"id\":1,\"title\":\"Vector Search\",\"content\":\"...\",\"\ knn_dist\":0.12}]" type: string responseError: oneOf: - $ref: "#/components/schemas/responseErrorDetails" - $ref: "#/components/schemas/responseErrorText" responseErrorDetails: description: Detailed error information returned in case of an error response properties: type: description: Type or category of the error type: string reason: description: Detailed explanation of why the error occurred nullable: true type: string table: description: "The table related to the error, if applicable" nullable: true type: string required: - type responseErrorText: description: Error message text returned in case of an error type: string errorResponse: description: Error response object containing information about the error and a status code example: status: 500 error: an error occured properties: error: $ref: "#/components/schemas/responseError" status: default: 500 description: HTTP status code of the error response type: integer required: - error sqlRawResponse: items: type: object type: array sqlObjResponse: properties: hits: type: object took: type: number timed_out: type: boolean required: - hits sqlResponse: description: List of responses from executed SQL queries example: - total: 0 error: null oneOf: - $ref: "#/components/schemas/sqlRawResponse" - $ref: "#/components/schemas/sqlObjResponse" tokenRequest: additionalProperties: false description: | Empty request body. Used to create or rotate a bearer token for the authenticated HTTP user. example: {} type: object tokenResponse: description: | Raw bearer token string. example: 115za1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2 type: string updateDocumentRequest: description: Payload for updating a document or multiple documents in a table properties: table: description: Name of the document table type: string cluster: description: Name of the document cluster type: string doc: additionalProperties: false description: Object containing the document fields to update example: gid: 10 type: object id: description: Document ID format: uint64 type: integer query: $ref: "#/components/schemas/queryFilter" required: - doc - table updateResponse: description: Success response returned after updating one or more documents example: table: test updated: 29 properties: table: description: Name of the document table type: string updated: description: Number of documents updated type: integer id: description: Document ID format: uint64 type: integer result: description: "Result of the update operation, typically 'updated'" type: string knn_query: oneOf: - type: string - items: type: number type: array geoDistance_location_anchor: additionalProperties: false description: Specifies the location of the pin point used for search properties: lat: description: Latitude of the anchor point type: number lon: description: Longitude of the anchor point type: number queryFilter_allOf_equals: description: Filter to match exact attribute values. type: object queryFilter_allOf_in: description: Filter to match a given set of attribute values. type: object queryFilter_allOf_range: description: Filter to match a given range of attribute values passed in Range objects type: object percolateRequest_query: additionalProperties: false example: percolate: document: title: some text to match properties: percolate: description: Object representing the document to percolate type: object required: - percolate searchResponse_hits: description: "Object containing the search hits, which represent the documents\ \ that matched the query." example: total: 2 hits: - _id: 1 _score: 1 _source: gid: 11 - _id: 2 _score: 1 _source: gid: 20 properties: max_score: description: Maximum score among the matched documents type: integer total: description: Total number of matched documents type: integer total_relation: description: Indicates whether the total number of hits is accurate or an estimate type: string hits: description: "Array of hit objects, each representing a matched document" items: $ref: "#/components/schemas/hitsHits" type: array securitySchemes: basicAuth: description: | HTTP Basic authentication with a Manticore user name and password. Required for `POST /token` when authentication and authorization is enabled. scheme: basic type: http bearerAuth: description: | Bearer authentication. The token is returned by the `POST /token` endpoint. scheme: bearer type: http