Phrase, filter and hybrid retrieval 00:00:01 Two nearly identical bike listings I'm trying to find a red electric bike, but one listing says 'red electric bike' and another says 'electric red bike'—they seem identical, but the word order might matter for search. The buyer typed 'electric' right before 'bike', so the system must match that exact sequence to return relevant results. A simple term match would include both, but a phrase requires electric to come immediately before bike, which only D1 satisfies. For an exact adjacent phrase the order matters. For a plain all-terms request it does not. Two users can type the same words and legitimately ask different questions, so make the query contract explicit. 00:00:45 Use positions for a phrase In document one, 'electric' appears directly before 'bike'—that's a perfect match for the phrase query. Document two has 'red' between 'electric' and 'bike', so it fails the exact adjacent phrase requirement. If we change the query to permit one intervening position, the second listing can pass that relaxed condition. The original strict adjacent phrase still rejects it. When phrase slop is deliberately changed, the query becomes more tolerant. Token positions and analyzer choices matter; changing the index analyzer may require rebuilding the data needed for those matches. 00:01:24 Keep the price ceiling hard We add a price filter set at 1,200 dollars to ensure only affordable bikes are considered. Even if a document scores high, any item over 1,200 dollars gets blocked before ranking begins. Only items passing the price filter move on to the next stage, so eligibility is strict and final. A hard price rule is an eligibility condition. It can be implemented at different points in a retrieval system, but no item violating that condition is allowed in the final returned set. 00:01:56 Add semantic candidates An embedding retriever finds a bike described as 'battery-powered cycle'—it matches the meaning, even with different words. For a different discovery request where the exact phrase is optional, combine identifiers from lexical and semantic candidate sources. Enforce any hard constraints, including the price ceiling, on the combined result. Raw lexical and vector scores often use different scales. Calibrate them before numerical combination or use a rank-based fusion rule that does not assume the raw numbers are comparable. Decide whether the phrase is a hard requirement or only a source of relevance evidence. A semantic alternative may complement the latter; it cannot bypass the former simply because its vector score looks impressive. 00:02:47 Test the customer promise We test the system by checking phrase alignment, price limits, synonym handling, and whether results are sparse. Even if a top-ranked item looks appealing, it’s excluded if it violates the price filter or phrase requirement. We trace each item through the pipeline and confirm that only those passing all stages appear in the final result. Use separate test queries for strict phrases, ordinary words, hard price filters and semantic alternatives. That makes an unexpected bicycle explainable as a candidate-generation issue, an eligibility error or a ranking choice.