I have a document with one field description
like this:
{
"_id": "item0",
"description": {
"parlist": [
{
"listitem": {
"text": {
"child": "page rous lady",
"keyword": "officer e"
}
}
},
{
"listitem": {
"text": "shepherd noble "
}
}
]
}
}
How to create text index on description
and search for specific word? I don't know how depth can description
go and how many children will description have. I tried with index creation like this:
db.collection.ensureIndex({description:"text"})
and then for query like this:
db.collection.runCommand("text",{$search:"shepherd"})
But it doesn't work.