I have a simple email analyzer
analyzer: {
email: {
tokenizer: 'uax_url_email',
filter: ['lowercase']
}
}
And a field with multiple email values:
field :emails,
type: :text,
analyzer: 'email',
search_analyzer: 'email',
value: -> (user) { [user.email, user.lead_requests.pluck(:email)].flatten.compact.uniq }
After indexing it I tried to find it, I need to find it by part of email:
UsersIndex.query(wildcard: { emails: "*example.com" }).count
=> 1
But with @:
UsersIndex.query(wildcard: { emails: "*@example.com" }).count
=> 0
And wildcard not worked for full email:
UsersIndex.query(wildcard: { email: "volk@example.com" }).count
=> 0
Only match can find it with full value:
UsersIndex.query(match: { emails: "volk@example.com" }).count
=> 1
Seems uax_url_email not worked for it as expected.
What should I do with it to make contains search working?