ロケーション(geo_point)とタイプ(short)の2つのフィールドを持つマッピングタイプがあります。
地理的な近接度によって自分の場所をリストし、この種のクエリを使用したい
{
"query": {
"bool": {
"filter": {
"geo_distance": {
"distance": "20km",
"location": {
"lat": 48.856614,
"lon": 2.3522219
}
}
}
}
},
"aggs": {
"types": {
"terms": {
"field": "type"
}
}
},
"post_filter": [],
"page": 1,
"size": 50,
"sort": [
{
"_geo_distance": {
"location": {
"lat": 48.856614,
"lon": 2.3522219
},
"order": "asc",
"unit": "km",
"distance_type": "plane"
}
}
]
}
特別なタイプの最初の2桁のみを含める方法はありますか(例:type = 2)?
回答 1 件
関連記事
- JSONから属性の値を取得するElasticsearchクエリ
- jsonbの子プロパティに基づいて除外するPostgresqlクエリ
- Elasticsearch:ネストされたフィールドでデータをフィルタリングする方法
- elasticsearchの間違った正規表現クエリ
- Kibana(ElasticSearch)でORクエリを作成するにはどうすればよいですか?
- 別のクエリの結果を除外するElasticsearchクエリ
- 結果集計elasticsearchのクエリ
- SQLComplex更新クエリフィルターの個別の値のみ
- Elasticsearchで0以外のクエリフィールドを実行する方法
- Elasticsearch '[bool]はフィールド[filter]'例外の解析に失敗しました
フィルターに別の句を追加します