Exercises: wildcard
and regex
wildcard
β
π Playground link: words that starts-with not matching as expected
Solution
"analyzer": "lucene.standard"
The matching needs to occur at the word level, and thus needs (non-keyword) tokenization.
And allowAnalyzedField: true
needs to be set, allowing searches when using a tokenizing analyzer.
regex
β
π Playground link: Full string regex not working as expected
Solution
"analyzer": "lucene.keyword"
Matching needs to occur across the full string, and thus needs to be lucene.keyword
analyzed so that the full string is indexed as a single unit.