Full Text Search inside Array

Hello,

let’s assume I’ve document with a similar structure as the one below:
{
“mydata”: “asdf”,

“childvalues”: [{
“name”: “my long name”,

},
{
“name”: “my other long name”

}]
}

And I want to do a full-text-search on the name field inside my array (childvalues) - so my idea was to create a FTS index with a child mapping for “childvalues”, I’ve tried it with “only index specific fields” option and a “name” child field and also without this option, but the full text search doesn’t return any results for the values in the array. I’ve also tried different analyzers (also simple and keyword to rule at any stopword issues)

What do I have to select at index creation, that the fields inside the array are searchable?

Hi @prainer, without the index definitions its hard to tell whats going wrong here.

I suspect you might have failed to specify the type of the document while specifying the mapping.
ref: Create a Search Index | Couchbase Docs

For a sample document like below,

{
“type”: “test”,
“childvalues”: [
{
“name”: “my long name”
},
{
“name”: “surname name”
},
{
“name”: “middle name”
}
]
}

following mapping works.