Posted on 12/07/2021 10:47:28
Hi Tomas,
In portuguese it's the same concept, but regardsless of it, you cannot do that in Lucene as far as I know.
You can set up an expression with a "Contains" operator on an field that is not analyzed, which allows you to find documents that match that exact string of characters (in your case "small microwave" - in other words the expression would not find "small practical microwave", but others would). But the "contains" operator does not account for scoring, so it cannot be used to "prioritize" results.
Scoring only happens with exact mathes, so only operators "Equal", "In", "MatchAny" and "MatchAll" work for scoring (prioritization) purposes.
You'll find other challenges when searching for multiple "words", because you can't determine when the user is typing 2 terms "microwave grill" (trying to search for "microwave" + the word "grill" vs a compound term ("small microwave"). With that in mind, you can hopefully guide the customer into another solution.
Best Regards,
Nuno Aguiar