@ericb thanks that’s what I was looking for, And can I get a nested object field along with other fields?
This is a sample document. How to return the location.district
with other fields?
{
"type": "SELL",
"category": {
"field": "property",
"item": "houses & apartments"
},
"location": {
"district": "Batticaloa",
"city": "Batticaloa"
},
"title": "The first thing I have done",
"price": 343444,
"fields": {
"property type": "apartment",
"furnishing": "fully-furnished",
"negotiable": true,
"floors": "25",
"landSize": {
"area": "500",
"unit": "arches"
}
},
"createdAt": "2020-11-03T14:58:21.648Z",
"creator": {
"name": "John Doe ",
"id": "caa8f854-fd49-43d3-b603-64f8f483a701"
},
"id": "-AePUFUwb5kLnNLST4yIx",
}
What I tried.
const result = await cluster.searchQuery("test-search", qp, {
limit,
skip,
fields: ["type", "title", "price", "photos", "location", "createdAt"],
});
But this only returns fields createdAt, photos, price, title, type