---
title: "Autocomplete Search Over Groups"
method: POST
path: "/api/chunk_group/group_oriented_autocomplete"
tags: ["Chunk Group"]
---

# Autocomplete Search Over Groups

`POST /api/chunk_group/group_oriented_autocomplete`

This route provides the primary autocomplete functionality for the API. This prioritize prefix matching with semantic or full-text search.

## Headers

- `TR-Dataset` string, uuid, required
- `X-API-Version` 'V1' | 'V2'

## Request body

- AutocompleteSearchOverGroupsReqPayload
  - `extend_results` boolean, nullable — If specified to true, this will extend the search results to include non-exact prefix matches of the same search_type such that a full page_size of results are returned. Default is false.
  - `filters` ChunkFilter — ChunkFilter is a JSON object which can be used to filter chunks. This is useful for when you want to filter chunks by arbitrary metadata. Unlike with tag filtering, there is a performance hit for filtering on metadata.
    - `must` ConditionType[], nullable — All of these field conditions have to match for the chunk to be included in the result set.
      - union — Filters can be constructed using either fields on the chunk objects, ids or tracking ids of chunks, and finally ids or tracking ids of groups.
        - FieldCondition — FieldCondition is a JSON object which can be used to filter chunks by a field. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
          - `boolean` boolean, nullable — Boolean is a true false value for a field. This only works for boolean fields. You can specify this if you want values to be true or false.
          - `date_range` DateRange — DateRange is a JSON object which can be used to filter chunks by a range of dates. This leverages the time_stamp field on chunks in your dataset. You can specify this if you want values in a certain range. You must provide ISO 8601 combined date and time without timezone.
            - `gt` string, nullable
            - `gte` string, nullable
            - `lt` string, nullable
            - `lte` string, nullable
          - `field` string, required — Field is the name of the field to filter on. Commonly used fields are `timestamp`, `link`, `tag_set`, `location`, `num_value`, `group_ids`, and `group_tracking_ids`. The field value will be used to check for an exact substring match on the metadata values for each existing chunk. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
          - `geo_bounding_box` LocationBoundingBox
            - `bottom_right` GeoInfo, required — Location that you want to use as the center of the search.
              - …
            - `top_left` GeoInfo, required — Location that you want to use as the center of the search.
              - …
          - `geo_polygon` LocationPolygon
            - `exterior` GeoInfo[], required
              - …
            - `interior` array[], nullable
              - …
          - `geo_radius` LocationRadius
            - `center` GeoInfo, required — Location that you want to use as the center of the search.
              - …
            - `radius` number, double, required
          - `match_all` MatchCondition[], nullable — Match all lets you pass in an array of values that will return results if all of the items match. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. If both match_all and match_any are provided, the match_any condition will be used.
            - union
              - …
          - `match_any` MatchCondition[], nullable — Match any lets you pass in an array of values that will return results if any of the items match. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. If both match_all and match_any are provided, the match_any condition will be used.
            - union
              - …
          - `range` Range
            - `gt` union
              - …
            - `gte` union
              - …
            - `lt` union
              - …
            - `lte` union
              - …
        - HasChunkIDCondition — HasChunkIDCondition is a JSON object which can be used to filter chunks by their ids or tracking ids. This is useful for when you want to filter chunks by their ids or tracking ids.
          - `ids` string[], nullable — Ids of the chunks to apply a match_any condition with. Only chunks with one of these ids will be returned.
          - `tracking_ids` string[], nullable — Tracking ids of the chunks to apply a match_any condition with. Only chunks with one of these tracking ids will be returned.
    - `must_not` ConditionType[], nullable — None of these field conditions can match for the chunk to be included in the result set.
      - union — Filters can be constructed using either fields on the chunk objects, ids or tracking ids of chunks, and finally ids or tracking ids of groups.
        - FieldCondition — FieldCondition is a JSON object which can be used to filter chunks by a field. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
          - `boolean` boolean, nullable — Boolean is a true false value for a field. This only works for boolean fields. You can specify this if you want values to be true or false.
          - `date_range` DateRange — DateRange is a JSON object which can be used to filter chunks by a range of dates. This leverages the time_stamp field on chunks in your dataset. You can specify this if you want values in a certain range. You must provide ISO 8601 combined date and time without timezone.
            - `gt` string, nullable
            - `gte` string, nullable
            - `lt` string, nullable
            - `lte` string, nullable
          - `field` string, required — Field is the name of the field to filter on. Commonly used fields are `timestamp`, `link`, `tag_set`, `location`, `num_value`, `group_ids`, and `group_tracking_ids`. The field value will be used to check for an exact substring match on the metadata values for each existing chunk. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
          - `geo_bounding_box` LocationBoundingBox
            - `bottom_right` GeoInfo, required — Location that you want to use as the center of the search.
              - …
            - `top_left` GeoInfo, required — Location that you want to use as the center of the search.
              - …
          - `geo_polygon` LocationPolygon
            - `exterior` GeoInfo[], required
              - …
            - `interior` array[], nullable
              - …
          - `geo_radius` LocationRadius
            - `center` GeoInfo, required — Location that you want to use as the center of the search.
              - …
            - `radius` number, double, required
          - `match_all` MatchCondition[], nullable — Match all lets you pass in an array of values that will return results if all of the items match. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. If both match_all and match_any are provided, the match_any condition will be used.
            - union
              - …
          - `match_any` MatchCondition[], nullable — Match any lets you pass in an array of values that will return results if any of the items match. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. If both match_all and match_any are provided, the match_any condition will be used.
            - union
              - …
          - `range` Range
            - `gt` union
              - …
            - `gte` union
              - …
            - `lt` union
              - …
            - `lte` union
              - …
        - HasChunkIDCondition — HasChunkIDCondition is a JSON object which can be used to filter chunks by their ids or tracking ids. This is useful for when you want to filter chunks by their ids or tracking ids.
          - `ids` string[], nullable — Ids of the chunks to apply a match_any condition with. Only chunks with one of these ids will be returned.
          - `tracking_ids` string[], nullable — Tracking ids of the chunks to apply a match_any condition with. Only chunks with one of these tracking ids will be returned.
    - `should` ConditionType[], nullable — Only one of these field conditions has to match for the chunk to be included in the result set.
      - union — Filters can be constructed using either fields on the chunk objects, ids or tracking ids of chunks, and finally ids or tracking ids of groups.
        - FieldCondition — FieldCondition is a JSON object which can be used to filter chunks by a field. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
          - `boolean` boolean, nullable — Boolean is a true false value for a field. This only works for boolean fields. You can specify this if you want values to be true or false.
          - `date_range` DateRange — DateRange is a JSON object which can be used to filter chunks by a range of dates. This leverages the time_stamp field on chunks in your dataset. You can specify this if you want values in a certain range. You must provide ISO 8601 combined date and time without timezone.
            - `gt` string, nullable
            - `gte` string, nullable
            - `lt` string, nullable
            - `lte` string, nullable
          - `field` string, required — Field is the name of the field to filter on. Commonly used fields are `timestamp`, `link`, `tag_set`, `location`, `num_value`, `group_ids`, and `group_tracking_ids`. The field value will be used to check for an exact substring match on the metadata values for each existing chunk. This is useful for when you want to filter chunks by arbitrary metadata. To access fields inside of the metadata that you provide with the card, prefix the field name with `metadata.`.
          - `geo_bounding_box` LocationBoundingBox
            - `bottom_right` GeoInfo, required — Location that you want to use as the center of the search.
              - …
            - `top_left` GeoInfo, required — Location that you want to use as the center of the search.
              - …
          - `geo_polygon` LocationPolygon
            - `exterior` GeoInfo[], required
              - …
            - `interior` array[], nullable
              - …
          - `geo_radius` LocationRadius
            - `center` GeoInfo, required — Location that you want to use as the center of the search.
              - …
            - `radius` number, double, required
          - `match_all` MatchCondition[], nullable — Match all lets you pass in an array of values that will return results if all of the items match. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. If both match_all and match_any are provided, the match_any condition will be used.
            - union
              - …
          - `match_any` MatchCondition[], nullable — Match any lets you pass in an array of values that will return results if any of the items match. The match value will be used to check for an exact substring match on the metadata values for each existing chunk. If both match_all and match_any are provided, the match_any condition will be used.
            - union
              - …
          - `range` Range
            - `gt` union
              - …
            - `gte` union
              - …
            - `lt` union
              - …
            - `lte` union
              - …
        - HasChunkIDCondition — HasChunkIDCondition is a JSON object which can be used to filter chunks by their ids or tracking ids. This is useful for when you want to filter chunks by their ids or tracking ids.
          - `ids` string[], nullable — Ids of the chunks to apply a match_any condition with. Only chunks with one of these ids will be returned.
          - `tracking_ids` string[], nullable — Tracking ids of the chunks to apply a match_any condition with. Only chunks with one of these tracking ids will be returned.
  - `group_size` integer, nullable — Group_size is the number of chunks to fetch for each group. The default is 3. If a group has less than group_size chunks, all chunks will be returned. If this is set to a large number, we recommend setting slim_chunks to true to avoid returning the content and chunk_html of the chunks so as to lower the amount of time required for content download and serialization.
  - `highlight_options` HighlightOptions — Highlight Options lets you specify different methods to highlight the chunks in the result set. If not specified, this defaults to the score of the chunks.
    - `highlight_delimiters` string[], nullable — Set highlight_delimiters to a list of strings to use as delimiters for highlighting. If not specified, this defaults to ["?", ",", ".", "!"]. These are the characters that will be used to split the chunk_html into splits for highlighting. These are the characters that will be used to split the chunk_html into splits for highlighting.
    - `highlight_max_length` integer, nullable — Set highlight_max_length to control the maximum number of tokens (typically whitespace separated strings, but sometimes also word stems) which can be present within a single highlight. If not specified, this defaults to 8. This is useful to shorten large splits which may have low scores due to length compared to the query. Set to something very large like 100 to highlight entire splits.
    - `highlight_max_num` integer, nullable — Set highlight_max_num to control the maximum number of highlights per chunk. If not specified, this defaults to 3. It may be less than 3 if no snippets score above the highlight_threshold.
    - `highlight_results` boolean, nullable — Set highlight_results to false for a slight latency improvement (1-10ms). If not specified, this defaults to true. This will add `<mark><b>` tags to the chunk_html of the chunks to highlight matching splits and return the highlights on each scored chunk in the response.
    - `highlight_strategy` 'exactmatch' | 'v1'
    - `highlight_threshold` number, double, nullable — Set highlight_threshold to a lower or higher value to adjust the sensitivity of the highlights applied to the chunk html. If not specified, this defaults to 0.8. The range is 0.0 to 1.0.
    - `highlight_window` integer, nullable — Set highlight_window to a number to control the amount of words that are returned around the matched phrases. If not specified, this defaults to 0. This is useful for when you want to show more context around the matched words. When specified, window/2 whitespace separated words are added before and after each highlight in the response's highlights array. If an extended highlight overlaps with another highlight, the overlapping words are only included once. This parameter can be overriden to respect the highlight_max_length param.
    - `post_tag` string, nullable — Custom html tag which should appear after highlights. If not specified, this defaults to '</mark></b>'.
    - `pre_tag` string, nullable — Custom html tag which should appear before highlights. If not specified, this defaults to '<mark><b>'.
  - `metadata` unknown
  - `page_size` integer, nullable — Page size is the number of chunks to fetch. This can be used to fetch more than 10 chunks at a time.
  - `query` union, required
    - object
      - `image_url` string, required
      - `llm_prompt` string, nullable
    - string
    - object
      - `audio_base64` string, required
  - `remove_stop_words` boolean, nullable — If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. Queries that are entirely stop words will be preserved.
  - `score_threshold` number, float, nullable — Set score_threshold to a float to filter out chunks with a score below the threshold. This threshold applies before weight and bias modifications. If not specified, this defaults to 0.0.
  - `scoring_options` ScoringOptions — Scoring options provides ways to modify the sparse or dense vector created for the query in order to change how potential matches are scored. If not specified, this defaults to no modifications.
    - `fulltext_boost` FullTextBoost — Boost the presence of certain tokens for fulltext (SPLADE) and keyword (BM25) search. I.e. boosting title phrases to priortize title matches or making sure that the listing for AirBNB itself ranks higher than companies who make software for AirBNB hosts by boosting the in-document-frequency of the AirBNB token (AKA word) for its official listing. Conceptually it multiples the in-document-importance second value in the tuples of the SPLADE or BM25 sparse vector of the chunk_html innerText for all tokens present in the boost phrase by the boost factor like so: (token, in-document-importance) -> (token, in-document-importance*boost_factor).
      - `boost_factor` number, double, required — Amount to multiplicatevly increase the frequency of the tokens in the phrase by
      - `phrase` string, required — The phrase to boost in the fulltext document frequency index
    - `semantic_boost` SemanticBoost — Semantic boosting moves the dense vector of the chunk in the direction of the distance phrase for semantic search. I.e. you can force a cluster by moving every chunk for a PDF closer to its title or push a chunk with a chunk_html of "iphone" 25% closer to the term "flagship" by using the distance phrase "flagship" and a distance factor of 0.25. Conceptually it's drawing a line (euclidean/L2 distance) between the vector for the innerText of the chunk_html and distance_phrase then moving the vector of the chunk_html distance_factor*L2Distance closer to or away from the distance_phrase point along the line between the two points.
      - `distance_factor` number, float, required — Arbitrary float (positive or negative) specifying the multiplicate factor to apply before summing the phrase vector with the chunk_html embedding vector
      - `phrase` string, required — Terms to embed in order to create the vector which is weighted summed with the chunk_html embedding vector
  - `search_type` 'fulltext' | 'semantic' | 'hybrid' | 'bm25', required
  - `slim_chunks` boolean, nullable — Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typically 10-50ms). Default is false.
  - `sort_options` SortOptions — Sort Options lets you specify different methods to rerank the chunks in the result set. If not specified, this defaults to the score of the chunks.
    - `location_bias` GeoInfoWithBias — Location bias lets you rank your results by distance from a location. If not specified, this has no effect. Bias allows you to determine how much of an effect the location of chunks will have on the search results. If not specified, this defaults to 0.0. We recommend setting this to 1.0 for a gentle reranking of the results, >3.0 for a strong reranking of the results.
      - `bias` number, double, required — Bias lets you specify how much of an effect the location of chunks will have on the search results. If not specified, this defaults to 0.0. We recommend setting this to 1.0 for a gentle reranking of the results, >3.0 for a strong reranking of the results.
      - `location` GeoInfo, required — Location that you want to use as the center of the search.
        - `lat` union, required
          - integer
          - number, double
        - `lon` union, required
          - integer
          - number, double
    - `mmr` MmrOptions — MMR Options lets you specify different methods to rerank the chunks in the result set using Maximal Marginal Relevance. If not specified, this defaults to the score of the chunks.
      - `mmr_lambda` number, float, nullable — Set mmr_lambda to a value between 0.0 and 1.0 to control the tradeoff between relevance and diversity. Closer to 1.0 will give more diverse results, closer to 0.0 will give more relevant results. If not specified, this defaults to 0.5.
      - `use_mmr` boolean, required — Set use_mmr to true to use the Maximal Marginal Relevance algorithm to rerank the results.
    - `recency_bias` number, float, nullable — Recency Bias lets you determine how much of an effect the recency of chunks will have on the search results. If not specified, this defaults to 0.0. We recommend setting this to 1.0 for a gentle reranking of the results, >3.0 for a strong reranking of the results.
    - `sort_by` union — Sort by lets you specify a method to sort the results by. If not specified, this defaults to the score of the chunks. If specified, this can be any key in the chunk metadata. This key must be a numeric value within the payload.
      - SortByField
        - `direction` 'desc' | 'asc'
        - `field` string, required — Field to sort by. This has to be a numeric field with a Qdrant `Range` index on it. i.e. num_value and timestamp
        - `prefetch_amount` integer, nullable — How many results to pull in before the sort
      - SortBySearchType
        - `prefetch_amount` integer, nullable — How many results to pull in before the rerabj
        - `rerank_query` string, nullable — Query to use for prefetching defaults to the search query
        - `rerank_type` 'semantic' | 'fulltext' | 'bm25' | 'cross_encoder', required
    - `tag_weights` object, nullable — Tag weights is a JSON object which can be used to boost the ranking of chunks with certain tags. This is useful for when you want to be able to bias towards chunks with a certain tag on the fly. The keys are the tag names and the values are the weights.
    - `use_weights` boolean, nullable — Set use_weights to true to use the weights of the chunks in the result set in order to sort them. If not specified, this defaults to true.
  - `typo_options` TypoOptions — Typo Options lets you specify different methods to correct typos in the query. If not specified, typos will not be corrected.
    - `correct_typos` boolean, nullable — Set correct_typos to true to correct typos in the query. If not specified, this defaults to false.
    - `disable_on_word` string[], nullable — Words that should not be corrected. If not specified, this defaults to an empty list.
    - `one_typo_word_range` TypoRange — The TypoRange struct is used to specify the range of which the query will be corrected if it has a typo.
      - `max` integer, nullable — The maximum number of characters that the query will be corrected if it has a typo. If not specified, this defaults to 8.
      - `min` integer, required — The minimum number of characters that the query will be corrected if it has a typo. If not specified, this defaults to 5.
    - `prioritize_domain_specifc_words` boolean, nullable — Auto-require non-english words present in the dataset to exist in each results chunk_html text. If not specified, this defaults to true.
    - `two_typo_word_range` TypoRange — The TypoRange struct is used to specify the range of which the query will be corrected if it has a typo.
      - `max` integer, nullable — The maximum number of characters that the query will be corrected if it has a typo. If not specified, this defaults to 8.
      - `min` integer, required — The minimum number of characters that the query will be corrected if it has a typo. If not specified, this defaults to 5.
  - `use_quote_negated_terms` boolean, nullable — If true, quoted and - prefixed words will be parsed from the queries and used as required and negated words respectively. Default is false.
  - `user_id` string, nullable — User ID is the id of the user who is making the request. This is used to track user interactions with the search results.

## Response `200`

Groups with embedding vectors which are similar to those in the request body

- SearchOverGroupsResponseBody
  - `corrected_query` string, nullable
  - `id` string, uuid, required
  - `results` SearchOverGroupsResults[], required
    - `chunks` ScoreChunk[], required
      - `chunk` union, required
        - SlimChunkMetadataWithArrayTagSet
          - `created_at` string, date-time, required
          - `dataset_id` string, uuid, required
          - `id` string, uuid, required
          - `image_urls` string[], nullable
          - `link` string, nullable
          - `location` GeoInfo — Location that you want to use as the center of the search.
            - `lat` union, required
              - …
            - `lon` union, required
              - …
          - `metadata` unknown
          - `num_value` number, double, nullable
          - `tag_set` string[], nullable
          - `time_stamp` string, date-time, nullable
          - `tracking_id` string, nullable
          - `updated_at` string, date-time, required
          - `weight` number, double, required
        - ChunkMetadata
          - `chunk_html` string, nullable — HTML content of the chunk, can also be an arbitrary string which is not HTML
          - `created_at` string, date-time, required — Timestamp of the creation of the chunk
          - `dataset_id` string, uuid, required — ID of the dataset which the chunk belongs to
          - `id` string, uuid, required — Unique identifier of the chunk, auto-generated uuid created by Trieve
          - `image_urls` string[], nullable — Image URLs of the chunk, can be any list of strings. Used for image search and RAG.
          - `link` string, nullable — Link to the chunk, should be a URL
          - `location` GeoInfo — Location that you want to use as the center of the search.
            - `lat` union, required
              - …
            - `lon` union, required
              - …
          - `metadata` unknown
          - `num_value` number, double, nullable — Numeric value of the chunk, can be any float. Can represent the most relevant numeric value of the chunk, such as a price, quantity in stock, rating, etc.
          - `tag_set` string[], nullable — Tag set of the chunk, can be any list of strings. Used for tag-filtered searches.
          - `time_stamp` string, date-time, nullable — Timestamp of the chunk, can be any timestamp. Specified by the user.
          - `tracking_id` string, nullable — Tracking ID of the chunk, can be any string, determined by the user. Tracking ID's are unique identifiers for chunks within a dataset. They are designed to match the unique identifier of the chunk in the user's system.
          - `updated_at` string, date-time, required — Timestamp of the last update of the chunk
          - `weight` number, double, required — Weight of the chunk, can be any float. Used as a multiplier on a chunk's relevance score for ranking purposes.
        - ContentChunkMetadata
          - `chunk_html` string, nullable
          - `id` string, uuid, required
          - `image_urls` string[], nullable
          - `num_value` number, double, nullable
          - `time_stamp` string, date-time, nullable
          - `tracking_id` string, nullable
          - `weight` number, double, required
      - `highlights` string[], nullable
      - `score` number, float, required
    - `file_id` string, uuid, nullable
    - `group` ChunkGroup, required
      - `created_at` string, date-time, required
      - `dataset_id` string, uuid, required
      - `description` string, required
      - `id` string, uuid, required
      - `metadata` unknown
      - `name` string, required
      - `tag_set` string[], nullable
      - `tracking_id` string, nullable
      - `updated_at` string, date-time, required
  - `total_pages` integer, required

## Other responses

- `400` — Service error relating to searching

---

[API](https://skmtc.net/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.net/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/versions/84583e7c9fc1/schema)
