Any way to specify fields not to index, but it should be stored

I have Json data to index into my index. I would like to skip some specific fields like nested_content before indexing a data.

Sample JSON data:

{
"Name": "Sangeeth",
"Cars": "Toyato",
"nested_content": {
"object" : "value",
"document" : {
"object" : "document",
"data" : {},
"nodes" : [
{
"object" : "block",
"type" : "paragraph",
"isVoid" : false,
"data" : {},
"nodes" : [
{
"object" : "text",
"leaves" : [
{
"object" : "leaf",
"text" : "Hello This is my first post",
"marks" : []
}
]
}
]
}
]
}
}
}

Please let me know if any way to solve this.

The typical way is to set "index": false for fields you don't want indexed, but they will be stored.

However, you can't do this with a nested object - the purpose of nesting is so that you can search against the sub-documents (the nested objects) 'correctly'. That being said, if you don't want the data indexed/query-able, then just use normal 'objects' rather than nested objects. Then you can use the enabled option to avoid indexing the object.

Edit: properly formatted/indented example code in questions will better enable people to answer.

1 Like

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