I'm dealing with a headache where it seems I can't find the correct set of parameters for the analyzer.
So here's the problem:
I have an index where some fields are type of text and some fields are "type": "keyword"
.
Let's say I have data like this:
{
"title": "quick lazy dog" // text
"source": "internet" //keyword
}
Now, when I search using a query:
"query_string": {
"query": "quick lazy dog",
"default_operator": "and",
"fields": ["title", "source"],
}
It works. But then, if I add a "stop" word. Like so:
"query_string": {
"query": "the quick lazy dog",
"default_operator": "and",
"fields": ["title", "source"],
}
It doesn't work anymore. It won't remove "the". And the issue it seems that there are different types of fields mixed. Because when I do it like this:
"query_string": {
"query": "the quick lazy dog",
"default_operator": "and",
"fields": ["title", "some_other_text_field"],
}
It works just fine.
I've been trying to configure custom analyzers, tweaking filters and tokenizer params, but I can't get it right.
Someone please help me!
Ah, btw. I'm trying to get it right for ES 5.6
we're currently migrating to ES 7, I think the semantics would slightly differ, but right now I need to solve it primarily for 5.6