liveBook · Manning

SearchRequest

As explained in Spring AI in Action

SearchRequest is a Spring AI request object that specifies the query and filtering or ranking parameters for vector-store similarity retrieval.

SearchRequest is the Spring AI request object used to configure vector-store similarity retrieval. In a document-questioning service, its query is the user’s question, while optional parameters restrict and tune the returned document chunks. section 4.4.1

Filtering game rules

GameRulesService injects a VectorStore and builds a SearchRequest from the player’s question, a normalized game title, a result limit, and a metadata filter before retrieving relevant rule chunks.

How Spring AI in Action covers it

How deep it goes
Explains query, metadata filtering, Top-K, and similarity thresholds through Java builder examples, without detailing retrieval internals.
Examples
Uses GameRulesService to retrieve game-specific rule chunks with query, normalized gameTitle filtering, Top-K, and similarity threshold settings.
What it assumes
Assumes a configured VectorStore and document metadata, while demonstrating request construction and filter expression syntax.
What you can do after
Build it from scratch with Spring AI builder methods and tune retrieved context for relevance, coverage, token usage, and cost.
How it connects
Connects vector stores, metadata filtering, Top-K, similarity thresholds, RAG, and QuestionAnswerAdvisor.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.