Whatsapp 7(999)133 53 75 info@changstudio.ru
7(999) 133-53-75 mail@ayupov.org

ElasticSearch

Автокомплит. 

GET /index/_search
{
"_source": [],
"size": 0,
"min_score": 0.5,
"query": {
"bool":{
"must": [
{
"wildcard": {
"location/address": {
"value": "*ака*"
}
}
}
],
"filter": [],
"should": [],
"must_not": []
}
},
"aggs": {
"auto_complete":{
"terms": {
"field" : "location/address",
"order": {
"_count": "asc"
}
}
}
}
}

еще вариант


{
"_source": [],
"size": 0,
"aggs": {
"location": {
"nested": {
"path": "location"
},
"aggs": {
"address": {
"nested": {
"path": "location.address"
},
"aggs": {
"lowercase": {
"terms": {
"field": "location.address._text.lowercase",
"order": {"_key": "asc"},
"include": ".*" + query + ".*",
"size": 5
},
"aggs": {
"keyword": {
"terms": {
"field": "location.address._text.keyword",
"order": {"_key": "asc"},
"size": 5
}
}
}
},
"lowercase1": {
"terms": {
"field": "location.address._text.decimal_digit",
/*"order": {"_key": "asc"},
"include": ".*" + query + ".*",*/
"size": 5
},
"aggs": {
"keyword": {
"terms": {
"field": "location.address._text.keyword",
"order": {"_key": "asc"},
"size": 5
}
}
}
}
}
},
"district": {
"nested": {
"path": "location.district"
},
"aggs": {
"lowercase": {
"terms": {
"field": "location.district._text.lowercase",
"order": {"_key": "asc"},
"include": ".*" + query + ".*",
"size": 5
},
"aggs": {
"keyword": {
"terms": {
"field": "location.district._text.keyword",
"order": {"_key": "asc"},
"size": 5
}
}
}
}
}
},
"region": {
"nested": {
"path": "location.region"
},
"aggs": {
"lowercase": {
"terms": {
"field": "location.region._text.lowercase",
"include": ".*" + query + ".*"
},
"aggs": {
"keyword": {
"terms": {
"field": "location.region._text.keyword",
"order": {"_key": "asc"},
"size": 5
}
}
}
}
}
},
"locality-name": {
"nested": {
"path": "location.locality-name"
},
"aggs": {
"lowercase": {
"terms": {
"field": "location.locality-name._text.lowercase",
"include": ".*" + query + ".*"
},
"aggs": {
"keyword": {
"terms": {
"field": "location.locality-name._text.keyword",
"order": {"_key": "asc"},
"size": 5/*,
"sales_bucket_sort": {
"bucket_sort": {
"sort": [{ 'locality-name>lowercase>_count': { "order": 'asc' } }],
},
},*/
}
}
}
}
}
},
"sub-locality-name": {
"nested": {
"path": "location.sub-locality-name"
},
"aggs": {
"lowercase": {
"terms": {
"field": "location.sub-locality-name._text.lowercase",
"include": ".*" + query + ".*"
},
"aggs": {
"keyword": {
"terms": {
"field": "location.sub-locality-name._text.keyword",
"order": {"_key": "asc"},
"size": 5
}
}
}
}
}
},
"country": {
"nested": {
"path": "location.country"
},
"aggs": {
"lowercase": {
"terms": {
"field": "location.country._text.lowercase",
"include": ".*" + query + ".*"
},
"aggs": {
"keyword": {
"terms": {
"field": "location.country._text.keyword",
"order": {"_key": "asc"},
"size": 5
}
}
}
}
}
}
}
},
"JK": {
"terms": {
"field": "building-name.lowercase",
"include": ".*" + query + ".*"
},
"aggs": {
"keyword": {
"terms": {
"field": "building-name.keyword",
"order": {"_key": "asc"}
}
}
}
}
}
}
Разработка сайта dopline.ru

Создание корпоративного сайта компании Доплайн

НПП ТехНефтеМаш

Разработка корпоративного сайта с каталогом продукции НПП ТехНефтеМаш

Продвижение ресторана PranaBar.ru в СПб

Разработка сайтов для вегетарианского ресторана Prana Bar

FirstTalents.ru

Каталог международных фестивалей и конкурсов Первые Таланты

UntiFlags.ru

Разработка интернет-магазина флажной продукции

Сервис CleanUp

Разработка сервиса по уборке квартир CleanUp