Actions12
Search
AI-generatedSummary
Searches a named vector collection for the nearest matches to a query vector and returns one n8n item per hit. Choose a ranking metric and result limit, and optionally filter metadata, rank on a leading dimension slice, or use a prebuilt IVF ANN index.
Inputs
- readOnly — Defaults to false. When enabled, permits this search and rejects write operations.
- collection (required) — Name of the collection to search.
- queryVector (required) — An array of finite numbers or a JSON string containing one. Its length must match the dimension configured in the Vector Store credentials.
- limit — Maximum number of hits to return; defaults to 50 and must be at least 1.
- metric — Ranking metric: cosine (default), dot product, Euclidean, or Manhattan. Ignored when Use ANN Index is enabled.
- filter — Optional JSON object string for a Mongo-style metadata post-filter. It is applied after scoring, so returned hits may have a score of 0; increase Limit when using a selective filter.
- dimSlice — Number of leading vector dimensions to use for ranking; defaults to 0, which uses all dimensions. Ignored when Use ANN Index is enabled.
- useIndex — Defaults to false. When enabled, searches the collection's IVF approximate-nearest-neighbor index. Build the index first; search errors if it is missing. ANN search uses cosine ranking and ignores Metric, Filter, and Dimension Slice. Rebuild the snapshot after bulk inserts or removals.
Output shape
A list of n8n items, one per matching hit.
Each item contains id, score, and metadata (an empty object when absent). Search reads the configured collection and returns the store's ranked hits up to Limit.