# Aggregation match forward slash and dot in query string

**URL:** <https://discuss.elastic.co/t/aggregation-match-forward-slash-and-dot-in-query-string/223397>\
**Category:** Elasticsearch\
**Created:** [March 12, 2020, 6:59pm UTC](https://discuss.elastic.co/t/aggregation-match-forward-slash-and-dot-in-query-string/223397 "2020-03-12T18:59:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkworker](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@kkworker](https://discuss.elastic.co/u/kkworker)\
**Post date:** [March 12, 2020, 6:59pm UTC](https://discuss.elastic.co/t/aggregation-match-forward-slash-and-dot-in-query-string/223397/1 "2020-03-12T18:59:40Z")

</div>

Hello everyone,

I just registered on this forum and ask my first question.

I use aggregation to search a field "ID". The values of such field in the documents are those like "98.4325/D3452SD2", where "." and "/" are included. I expect that as long as I type something like "34.8765/D" in the search box, I wish that the top matching values, such as "34.8765/D3345", "34.8765/D2FD4D", ""34.8765/D567FFG", and so on will be returned back.

So I use "include" parameter to filter the result, but no matter the dot and forward slash are escaped or not, there is nothing returned back. The code shows below. Can anyone please advise how to solve this issue?

$params = [  
'index' =\> $this-\>index,  
'type' =\> '\_doc',  
'body' =\> [  
'size' =\> 0,  
'aggs' =\> [  
$field =\> [  
'terms' =\> [  
'field' =\> $field,  
'include' =\> '._' . strtolower(str\_replace([".", "/"], [".", "/"], $string)) . '._|._' . strtoupper(str\_replace([".", "/"], [".", "/"], $string)) . '._'  
]  
]  
]  
]  
];

Thank you,

---

<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:** [April 9, 2020, 6:59pm UTC](https://discuss.elastic.co/t/aggregation-match-forward-slash-and-dot-in-query-string/223397/2 "2020-04-09T18:59:46Z")

</div>

Closed on April 9, 2020, 6:59pm UTC

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