I use a wildcard query on fields indexed with a keyword analyzer. I want to find the following document
{
title: "JavaScript beginner course",
url: "https://youtube.com/xyz"
}
with these queries: *beginner course*
and *youtube*
(*
are wildcards). This is working.
When I search for *Java*
, the document above will also match. That’s fine. However, I want to boost search results with exact word matches. Meaning, a document with Java
in the title should have a higher search score.
Problem is, the keyword analyzer doesn’t index each word separately. But I need the keyword analyzer, because otherwise *beginner course*
wouldn’t match in the example above.
Is there a way to achieve exact matching with wildcard search + a keyword analyzer?