I'm experiencing trouble with requesting fileds making requests on field with spaces. Mapping looks like this:
"myIndexName": {
"mappings": {
"myType": {
"properties": {
"myPropertyWithSpaces": {
"type": "string",
"analyzer": "analyzer_keyword"
}
}
}
}
}
There "analyzer_keyword" is cutom analyzer with keyword tokenizer and lowercase filter. When I'm sending "_analyze" request with "analyzer_keyword" analyzer and query like "firstWord secondWord" I get only token "firstword secondword" - everything works as expected. But querystring request returns nothing if I don't change space character to "?" wildcard; interesting, that lowercasing still works and such behaviour doesn't change if I'm telling elasticsearch to use this "analyzer_keyword" explicitly.
"query": {
"query_string": {
"query": "firstWord secondWord",
"default_field": "myPropertyWithSpaces",
"analyzer": "analyzer_keyword"
}
By default, you cannot use from and size to page through more than 10,000 hits. This limit is a safeguard set by the index. max_result_window index setting. If you need to page through more than 10,000 hits, use the search_after parameter instead.
The reason might be that you haven't provided the size parameter in the query. This limits the result count to 10 by default. Out of all the results the top 10 might be from the two index even thought the match is present in third index as well.
Slow queries are often caused byPoorly written or expensive search queries. Poorly configured Elasticsearch clusters or indices. Saturated CPU, Memory, Disk and network resources on the cluster.
Found solution in simple escaping space character as "\ ". Works correctly and prevents queryString processor from injecting any "AND OR" operators or whatever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With