Hi,
I am facing some problem with highlighting nested values
Mapping
"acts" : {
"type" : "nested",
"include_in_parent" : true,
"properties" : {
"value" : {
"type" : "text",
"analyzer" : "my_analyzer_acts"
}
}
},
Index Data
"acts": [
{
"value": "Civil Procedure Code, 1908 (CPC) - Section 161, Section 173(8), Section 311, Section 319, Section 391"
},
{
"value": "Constitution of India, 1950 - Article 20, Article 21, Article 226, Article 32"
},
{
"value": "Delhi Special Police Establishment Act, 1946 - Section 6"
},
{
"value": "Evidence Act, 1872 - Section 165"
},
{
"value": "Explosive Substances Act, 1908 - Section 3, Section 4"
},
{
"value": "Penal Code, 1860 (IPC) - Section 120B, Section 147, Section 148, Section 149, Section 302, Section 307"
}
],
Query
{
"nested": {
"path": "acts",
"query": {
"bool": {
"must": [
{
"match": {
"acts.value": {
"query": "Evidence Act, 1872 section 165",
"operator" : "and"
}
}
}
]
}
}
}
},
{
"nested": {
"path": "acts",
"query": {
"bool": {
"must": [
{
"match": {
"acts.value": {
"query": "Civil Procedure Code, 1908",
"operator" : "and"
}
}
}
]
}
}
}
}
Result
"highlight": {
"acts.value": [
"Civil Procedure Code, 1908 (CPC) - <em>Section</em> 161, <em>Section</em> 173(8), <em>Section</em> 311, <em>Section</em> 319, <em>Section</em> 391",
"Delhi Special Police Establishment <em>Act,</em> 1946 - <em>Section</em> 6",
"<em>Evidence</em> <em>Act,</em> <em>1872</em> - <em>Section</em> <em>165</em>",
"Explosive Substances <em>Act,</em> 1908 - <em>Section</em> 3, <em>Section</em> 4",
"Penal Code, 1860 (IPC) - <em>Section</em> 120B, <em>Section</em> 147, <em>Section</em> 148, <em>Section</em> 149, <em>Section</em> 302, <em>Section</em> 307"
]
}
Expected Result-
In above acts "Civil Procedure Code, 1908" exists but its not highlighting.
Here i found some links
[https://github.com/elastic/elasticsearch/issues/5245#issuecomment-54712079]
Elasticsearch highlight with nested objects
but its long back,
Is it possible to highlight all nested values