搜索需求是:
筛选出:feed_status=1,sex=1,create_time为一天前,经纬度为指定经纬度的记录。
搜索query为:
但是始终报:
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse search source. expected field name but got [START_OBJECT]"}],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "feeds_nearby",
"node": "GAn6WDVCQJKnocLFgVLBfw",
"reason": {
"type": "parse_exception",
"reason": "failed to parse search source. expected field name but got [START_OBJECT]"}}]},
"status": 400}
还望各位大神指教!
筛选出:feed_status=1,sex=1,create_time为一天前,经纬度为指定经纬度的记录。
搜索query为:
{
"query": {
"bool": {
"must": [
{
"term": {
"feed_status": 0
}
},
{
"terms": {
"sex": [
1,
2
]
}
},
{
"range": {
"create_time": {
"gte": "now-1h"
}
}
}
]
},
"_source": {
"include": [
"feed_id",
"city",
"view_times",
"like_num",
"exposure",
"sex",
"uid",
"has_face",
"create_time",
"feed_status"
]
},
"from": 0,
"size": 5,
"sort": [
{
"_geo_distance": {
"location": {
"lat": 30.67,
"lon": 104.06
},
"order": "asc",
"unit": "km",
"distance_type": "plane"
}
}
]
}
}
但是始终报:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "failed to parse search source. expected field name but got [START_OBJECT]"}],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "feeds_nearby",
"node": "GAn6WDVCQJKnocLFgVLBfw",
"reason": {
"type": "parse_exception",
"reason": "failed to parse search source. expected field name but got [START_OBJECT]"}}]},
"status": 400}
还望各位大神指教!
0 个回复