FTS child mapping

My document structure is something like this,I want to perform FTS on pageContent,

{
“_type”: “Book”,
“title”: “2222”,
“comment”: “”,
“pages”: [{
“pageNo”: “1”,
pageContent”: “First grade English”
}, {
“pageNo”: “2”,
pageContent”: “Today is holiday”
}, {
“pageNo”: “3”,
pageContent”: “In fifth grade math students predict the relative size of solutions in addition, subtraction, multiplication, and division of whole numbers, addition, subtraction, and multiplication of fractions, decimals, and mixed numbers.”
}]
}

Below is my FTS index definition,

{
“type”: “fulltext-index”,
“name”: “sbook-test”,
“uuid”: “4b3dd2c54599aca7”,
“sourceType”: “couchbase”,
“sourceName”: “content”,
“sourceUUID”: “38b1bf06c557d262b3b8df46ba6c5f46”,
“planParams”: {
“maxPartitionsPerPIndex”: 171
},
“params”: {
“doc_config”: {
“docid_prefix_delim”: “”,
“docid_regexp”: “”,
“mode”: “type_field”,
“type_field”: “_type”
},
“mapping”: {
“analysis”: {},
“default_analyzer”: “standard”,
“default_datetime_parser”: “dateTimeOptional”,
“default_field”: “_all”,
“default_mapping”: {
“default_analyzer”: “”,
“dynamic”: true,
“enabled”: false
},
“default_type”: “_default”,
“docvalues_dynamic”: true,
“index_dynamic”: true,
“store_dynamic”: false,
“type_field”: “_type”,
“types”: {
“SBookPublish”: {
“default_analyzer”: “”,
“dynamic”: false,
“enabled”: true,
“properties”: {
“pages”: {
“default_analyzer”: “”,
“dynamic”: true,
“enabled”: true,
“properties”: {
“pageContent”: {
“default_analyzer”: “”,
“dynamic”: false,
“enabled”: true,
“fields”: [
{
“include_in_all”: true,
“include_term_vectors”: true,
“index”: true,
“name”: “pageContent”,
“store”: true,
“type”: “text”
}
]
},
“pageNo”: {
“default_analyzer”: “”,
“dynamic”: false,
“enabled”: true,
“fields”: [
{
“include_term_vectors”: true,
“index”: true,
“name”: “pageNo”,
“store”: true,
“type”: “text”
}
]
}
}
}
}
}
}
},
“store”: {
“indexType”: “upside_down”,
“kvStoreName”: “mossStore”
}
},
“sourceParams”: {}
}

If I run this,

I want to get only searched pages.pageNo but here I am getting all pageNo’s.

I need output something like, page 2 and 3 should not come in result set.
Actually pageNo 2 and 3 doesn’t have searched term(It is concatenating pages.pageNo).

If you see document only 1 st page object is having search term English.

Can anyone suggest me something ?

@suraj.sutar,
Your document model may not work well with CB FTS as it is only capable of identifying search occurrences at a document level, and not at any nested sub object level. So there is no way you can restrict your search scope to a particular page alone.
Meaning - if the search term “English” has an occurrence anywhere in the book document, the FTS will identify the book object as a matching document.

Which release you are testing this?
Can you click on the “Show Advanced Query settings” checkbox shown at the top and attach a screen shot.
Curious to know the query getting fired as it looks like you are explicitly fetching the field contents back?

Cheers!

Hi @sreeks
Version :
Enterprise Edition 5.5.1 build 3511

Is there any alternative to achieve the above scenario .