younifyd
Menu

Send multiple search requests in a single HTTP request

send multiple search requests in a single HTTP request

POST/multi_search

Use it in a workflow

  1. Add a step and choose the Typesense connector.
  2. Pick the Send multiple search requests in a single HTTP request action (under documents).
  3. Fill in the fields below, then reference the result from later steps as {{sendMultipleSearchRequestsInASingleHttpRequest.response.data}}.

Request

Query parameters

multiSearchParametersobjectrequired

Parameters for the multi search API.

qstring

The query text to search for in the collection. Use * as the search string to return all documents. This is typically useful when used in conjunction with filter_by.

query_bystring

A list of `string` fields that should be queried against. Multiple fields are separated with a comma.

query_by_weightsstring

The relative weight to give each `query_by` field when ranking results. This can be used to boost fields in priority, when looking for matches. Multiple fields are separated with a comma.

text_match_typestring

In a multi-field matching context, this parameter determines how the representative text match score of a record is calculated. Possible values are max_score (default) or max_weight.

prefixstring

Boolean field to indicate that the last word in the query should be treated as a prefix, and not as a whole word. This is used for building autocomplete and instant search interfaces. Defaults to true.

infixstring

If infix index is enabled for this field, infix searching can be done on a per-field basis by sending a comma separated string parameter called infix to the search query. This parameter can have 3 values; `off` infix search is disabled, which is default `always` infix search is performed along with regular search `fallback` infix search is performed if regular search does not produce results

max_extra_prefixinteger

There are also 2 parameters that allow you to control the extent of infix searching max_extra_prefix and max_extra_suffix which specify the maximum number of symbols before or after the query that can be present in the token. For example query "K2100" has 2 extra symbols in "6PK2100". By default, any number of prefixes/suffixes can be present for a match.

max_extra_suffixinteger

There are also 2 parameters that allow you to control the extent of infix searching max_extra_prefix and max_extra_suffix which specify the maximum number of symbols before or after the query that can be present in the token. For example query "K2100" has 2 extra symbols in "6PK2100". By default, any number of prefixes/suffixes can be present for a match.

filter_bystring

Filter conditions for refining youropen api validator search results. Separate multiple conditions with &&.

enable_lazy_filterboolean

Applies the filtering operation incrementally / lazily. Set this to true when you are potentially filtering on large values but the tokens in the query are expected to match very few documents. Default: false

max_filter_by_candidatesinteger

Controls the number of similar words that Typesense considers during fuzzy search on filter_by values. Useful for controlling prefix matches like company_name:Acm*.

sort_bystring

A list of numerical fields and their corresponding sort orders that will be used for ordering your results. Up to 3 sort fields can be specified. The text similarity score is exposed as a special `_text_match` field that you can use in the list of sorting fields. If no `sort_by` parameter is specified, results are sorted by `_text_match:desc,default_sorting_field:desc`

facet_bystring

A list of fields that will be used for faceting your results on. Separate multiple fields with a comma.

max_facet_valuesinteger

Maximum number of facet values to be returned.

facet_querystring

Facet values that are returned can now be filtered via this parameter. The matching facet text is also highlighted. For example, when faceting by `category`, you can set `facet_query=category:shoe` to return only facet values that contain the prefix "shoe".

facet_query_num_typosinteger

Controls the fuzziness of the facet query filter. Default: 2.

num_typosstring

The number of typographical errors (1 or 2) that would be tolerated. Default: 2

pageinteger

Results from this specific page number would be fetched.

per_pageinteger

Number of results to fetch per page. Default: 10

limitinteger

Number of hits to fetch. Can be used as an alternative to the per_page parameter. Default: 10.

offsetinteger

Identifies the starting point to return hits from a result set. Can be used as an alternative to the page parameter.

group_bystring

You can aggregate search results into groups or buckets by specify one or more `group_by` fields. Separate multiple fields with a comma. To group on a particular field, it must be a faceted field.

group_limitinteger

Maximum number of hits to be returned for every group. If the `group_limit` is set as `K` then only the top K hits in each group are returned in the response. Default: 3

group_missing_valuesboolean

Setting this parameter to true will place all documents that have a null value in the group_by field, into a single group. Setting this parameter to false, will cause each document with a null value in the group_by field to not be grouped with other documents. Default: true

group_max_candidatesinteger

Overrides the behavior of group_by queries where found value is an approximation. When group_max_candidates is passed, found will be accurate up until its value.

include_fieldsstring

List of fields from the document to include in the search result

exclude_fieldsstring

List of fields from the document to exclude in the search result

highlight_full_fieldsstring

List of fields which should be highlighted fully without snippeting

highlight_affix_num_tokensinteger

The number of tokens that should surround the highlighted text on each side. Default: 4

highlight_start_tagstring

The start tag used for the highlighted snippets. Default: `<mark>`

highlight_end_tagstring

The end tag used for the highlighted snippets. Default: `</mark>`

snippet_thresholdinteger

Field values under this length will be fully highlighted, instead of showing a snippet of relevant portion. Default: 30

drop_tokens_thresholdinteger

If the number of results found for a specific query is less than this number, Typesense will attempt to drop the tokens in the query until enough results are found. Tokens that have the least individual hits are dropped first. Set to 0 to disable. Default: 10

drop_tokens_modestring

Dictates the direction in which the words in the query must be dropped when the original words in the query do not appear in any document. Values: right_to_left (default), left_to_right, both_sides:3 A note on both_sides:3 - for queries up to 3 tokens (words) in length, this mode will drop tokens from both sides and exhaustively rank all matching results. If query length is greater than 3 words, Typesense will just fallback to default behavior of right_to_left

One ofright_to_leftleft_to_rightboth_sides:3

typo_tokens_thresholdinteger

If the number of results found for a specific query is less than this number, Typesense will attempt to look for tokens with more typos until enough results are found. Default: 100

enable_typos_for_alpha_numerical_tokensboolean

Set this parameter to false to disable typos on alphanumerical query tokens. Default: true.

filter_curated_hitsboolean

Whether the filter_by condition of the search query should be applicable to curated results (curation definitions, pinned hits, hidden hits, etc.). Default: false

enable_synonymsboolean

If you have some synonyms defined but want to disable all of them for a particular search query, set enable_synonyms to false. Default: true

enable_analyticsboolean

Flag for enabling/disabling analytics aggregation for specific search queries (for e.g. those originating from a test script).

Default true

synonym_prefixboolean

Allow synonym resolution on word prefixes in the query. Default: false

Request body

Enter the body as JSON in the step's Body field.

unionboolean

When true, merges the search results from each search query into a single ordered set of hits.

Default false

searchesarray<any>required
json
{
  "searches": [
    null
  ],
  "union": false
}

Response

Returns 200 with an object. Read it in later steps with {{sendMultipleSearchRequestsInASingleHttpRequest.response.data.<field>}}.

resultsarray<any>
conversationobject
answerstringrequired
conversation_historyarray<object>required
conversation_idstringrequired
querystringrequired
json
{
  "results": [
    null
  ],
  "conversation": {
    "answer": "string",
    "conversation_history": [
      {}
    ],
    "conversation_id": "string",
    "query": "string"
  }
}

Need more? See the Typesense guide for connection setup and behaviour shared by every action.