我正在尝试获取具有以下字段的项目列表:resellable: true
。
这是我可以通过访问看到的数据集:my-domain.com/_all/listings/_search
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 4,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "collectibles",
"_type" : "listing",
"_id" : "SseZfNbpdpBxc3O",
"_score" : 1.0,
"_source" : {
"data" : {
"resellable" : true,
"active" : true,
"description" : "<p>1234 123 123 123</p>",
"title" : "2134",
"has_store" : true,
"createdAt" : "Wed May 27 2020 04:23:18 GMT+0000 (Coordinated Universal Time)",
"apiURL" : "kJ9zsIsdQG8TZrRfPco4",
"id" : "SseZfNbpdpBxc3O",
"state" : "PENDING",
"amount" : "21",
}
}
}
}
我的查询正在使用*NodeJS and ElasticSearch.js*
let results = await client.search({
index: params.category,
type: "listing",
body: {
query: {
multi_match: {
query: true,
fields: ['resellable', 'active'],
type: 'best_fields',
}
}
}
})
响应总是no hits
。我试过 a match
,我试过 no best_fields
,它似乎与值不匹配。
我在这里做错了什么?您还需要做些什么来查询_source.data
关卡项目吗?
ElasticSearch version: 7.4