Is it possible to Return only one filed with Id

[
{
"_index": "onlive",
"_type": "_doc",
"_id": "584",
"_score": 1,
"_source": {
"description": "Free group Yoga session !!! for all levels Experience authentic Yoga from ancient scriptures",
"name": "Free Yoga 108 asanas in 1hr",
"hostname": "ghost",
"username": "account_1",
"category_name": "Other"
}
},
{
....
},
]

  • This is my data. I apply search on description, name, hostname, username, and category_name. but it returns all this field when data matched in any one field. I want only matched filed and id returns when search word found.

Hi @mayank_hardiya, this guide shows you how to select fields to retrieve.

but it did not return value like - { '_id': '584', 'hostname':'ghost'}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.