search

This block is part of the storage group and was last modified in core v13.0.4.

Storage Selection Required

This block relies on a storage to perform its storage releated actions. You must manually select the storage you want to use in your flow using the storage selector modal. To access the modal, click the white button on the block.

search v13.0.4

searches in the given storage based on a query.

In pins 5 + flow
  • flow
    flow
  • Query required
    query

    choose the query you would like to run, keep them simple for speed. • Suggestions: query_bool_must query_bool_must_not query_bool_should

  • Limit
    number

    Default 5000

  • Offset
    number
  • Cache Key v13.0.4
    value

    You can use this option to serve cached results for frequently used and resource-intensive searches. If the data doesn't change, repeated searches with the same cache key retrieve results from the same request cache. For time series use cases, such as logging, data in older data is rarely updated and can be served directly from this cache.

  • Storage
    storage
Out pins 8 + flow
  • flow
    flow
  • Results
    array

    Array of objects, each object is a single document. All results always include _meta.

  • hits
    number

    Number of documents found matching the given query.

  • guids v10.6.2
    array
  • Has hits
    condition
  • Profile
    array

    Analyzed profile of the query, this data is gathered only when the query includes the Profile action.

  • success
    condition
  • error
    value
  • cursor
    array

    Sort values of the last hit. Pass this to a search_after query block for cursor-based pagination.

database

A function trigger starts the flow, a term query built with fields and must feeds the query pin, and search returns the matching documents. The results array is counted with length here; in API blueprints it typically goes straight to the reply.

Studio canvas example for the search block: searching a storage with a query.

Commonly used with

One of the most-used blocks across production blueprints. It is most often wired together with:

  • branch: wired in both directions with this block.
  • must: feeds into this block. All queries provided must match.
  • reply in JSON: this block feeds into it. Reply to any httpconnection as JSON body.
  • create: feeds into this block. Creates a new function that can be executed using the given name.
  • filter: feeds into this block. Build a custom query using higher-level bool query.
  • multiple: feeds into this block.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v13.0.4.

v10.6.2 This block or one of its pins was updated in v10.6.2, click here to see the release notes.
Back to storage Return to the main group to view all sub-groups Back to storage Return to the group to view all blocks within this group