# How to make query on inside document split

**URL:** <https://discuss.elastic.co/t/how-to-make-query-on-inside-document-split/113558>\
**Category:** Elasticsearch\
**Created:** [December 29, 2017, 9:38am UTC](https://discuss.elastic.co/t/how-to-make-query-on-inside-document-split/113558 "2017-12-29T09:38:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjireddy543](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anjireddy543](https://discuss.elastic.co/u/anjireddy543)\
**Post date:** [December 29, 2017, 9:38am UTC](https://discuss.elastic.co/t/how-to-make-query-on-inside-document-split/113558/1 "2017-12-29T09:38:23Z")

</div>

Hi,

I have a index field Called Test and it contains few documents

Doc1:-

`<li>Presidency Towns Insolvency, 1909 &mdash; Section 53, 168</li><li>Evidence, 1872 &mdash; Section 45</li><li>Negotiable Instruments, 1881 (NI) &mdash; Section 138, 235, 45</li><li>Negotiable Instruments, 1881 (NI) &mdash; Section 131</li>`

Doc2 :- `<li>Negotiable Instruments, 1881 (NI) &mdash; Section 131</li><li>Criminal Procedure Code, 1898 (CrPC) &mdash; Section 223</li><li>Penal Code, 1860 (IPC) &mdash; Section 149</li>`

`I need to search my query between only <li> tags`  
EX:-  
Query :- `Negotiable Instruments, 1881 &mdash; Section 168, 45 (boolean AND) (In doc1 entire text is their but i want to check in only between <li>`)  
Expected Results: 0

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [January 5, 2018, 8:36pm UTC](https://discuss.elastic.co/t/how-to-make-query-on-inside-document-split/113558/2 "2018-01-05T20:36:06Z")

</div>

It is NOT very clear to me what you are trying to do.

Do you want to treat each `<li>` element as a separate document? And when you search for a query, do you want to return separate `<li>` elements that correspond to your query?

Or are you interested more in a phrase search - looking for a particular phrase inside a document?

---

<div class="post-metadata">

**Author:** ![anjireddy543](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anjireddy543](https://discuss.elastic.co/u/anjireddy543)\
**Post date:** [January 8, 2018, 9:17am UTC](https://discuss.elastic.co/t/how-to-make-query-on-inside-document-split/113558/3 "2018-01-08T09:17:18Z")

</div>

Thanks for replay.

I Found solution for this problem, I need to use array for this field. Every `<li>` consider as array element.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 5, 2018, 9:17am UTC](https://discuss.elastic.co/t/how-to-make-query-on-inside-document-split/113558/4 "2018-02-05T09:17:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
