can you provide a fully reproducible example which contains the documents you are indexing, along with the mapping containing the whitespace analyzer? This way it is possible to follow your steps and see where things go sideways. This also means you should explain your expectations in order to better understand.
(CPC) - Order 2 Rule 2, Order 2 Rule 2(3), Order 22 Rule 9, Order 23 Rule 1, Order 39 Rule 1, Order 39 Rule 2, Order 9 Rule 4, Order 9 Rule 8, Order 9 Rule 9, Section 11,12 , Article 35,38
(CPC) Section 8
(CPC) Order 11 Rule 1
If i search for Section 8 its matching first document also but its need to match only second document.
i think i can achieve this with nested object but their is a issue with highlight in nested objects.
this is nowhere near the fully reproducible example I asked for, so my answer will be more of guessing.
In order to understand how your data gets indexed, you should run the analyze API against your fields. This will show you, how the data is indexed into elasticsearch and which tokens are being generated. Fiddling around with different analyzers will show you different tokens.
A good analyzer in this case would leave the numbers fully intact and you might be able to use a match phrase query to find proper documents.
Again as you have neither specified how your data is indexed nor which query you are using, it's hard to help.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.