Voici comment reproduire le problème :
Mapping
curl -XPUT "http://127.0.0.1:9200/fuzzyindex" -d '{
"settings": {
"index.mapping.total_fields.limit": 5000,
"number_of_shards": 1,
"number_of_replicas": 1,
"index.max_result_window": 50000
},
"mappings": {
"fuzzytype": {
"properties": {
"offer": {
"type": "nested",
"properties": {
"geo" : {
"type": "geo_point"
},
"name": {
"type": "text",
"analyzer": "french"
}
}
}
}
}
}
}'
Indexing
curl -XPUT "http://127.0.0.1:9200/fuzzyindex/fuzzytype/1" -d '{
"offer": {
"geo": {
"lat": 48,
"lon": 2
},
"name": "disneyland"
}
}'
Querying
Exemple 1 : correct
curl -XPOST "http://127.0.0.1:9200/fuzzyindex/fuzzytype/_search" -d '{
"query" : {
"bool": {
"must" : [
{
"nested": {
"path": "offer",
"query": {
"simple_query_string": {
"query": "disneylan~1",
"analyzer": "french",
"fields": [
"offer.name"
],
"default_operator": "or"
}
}
}
}
]
}
}
}'
Exemple 2 : incorrect
curl -XPOST "http://127.0.0.1:9200/fuzzyindex/fuzzytype/_search" -d '{
"query" : {
"bool": {
"must" : [
{
"nested": {
"path": "offer",
"query": {
"simple_query_string": {
"query": "disneylan~",
"analyzer": "french",
"fields": [
"offer.name"
],
"default_operator": "or"
}
}
}
}
]
}
}
}'