A municipal code-search assistant must apply keyword filters then rank by semantic similarity across Azure data services. What approach fits?
Select an answer to reveal the explanation.
Short Explanation
You can narrow the code to the right jurisdiction, title, or keywords with PostgreSQL, then use vector search to rank passages by meaning. Hybrid retrieval helps residents find relevant code without burying them in unrelated sections.
Full Explanation
A municipal code-search assistant that must apply keyword filters and then rank by semantic similarity should use hybrid retrieval: apply PostgreSQL keyword or metadata filters, then rank the remaining passages with pgvector or Redis vector search. Filtering narrows results to constraints such as jurisdiction, title, or keywords; vector ranking then surfaces passages that best match resident intent. This hybrid pattern fits Azure data services for legal and code corpora. Returning every code section without filters or ranking would overwhelm users and models with irrelevant text. Sorting Blob Storage filenames alphabetically does not determine legal relevance because filenames do not capture the meaning of passage text or apply structured filters. Asking residents to memorize statute numbers abandons the assistant’s purpose instead of providing retrieval. Exam caveat: hybrid retrieval can use pre-filtering followed by nearest-neighbor ranking or fused scoring; when a question specifies keyword filters followed by semantic ranking, identify the hybrid design. Practical check: for a sample ordinance query, log the filtered candidate count against the unfiltered corpus size, have legal subject-matter experts verify the semantic ranking, and track answer groundedness with hybrid retrieval enabled.