I'm trying to fetch a list of items that have the field: resellable: true
.
Here is my data set I can see by visiting: 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",
}
}
}
}
My query is using *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',
}
}
}
})
The response is always no hits
. I've tried a match
, I've tried no best_fields
and it doesn't seem to match the value.
What am I doing wrong here? Is there something else you need to do to query the _source.data
level items?
ElasticSearch version: 7.4