# Search pattern with a forward slash

**URL:** <https://discuss.elastic.co/t/search-pattern-with-a-forward-slash/17028>\
**Category:** Elasticsearch\
**Created:** [April 15, 2014, 3:04pm UTC](https://discuss.elastic.co/t/search-pattern-with-a-forward-slash/17028 "2014-04-15T15:04:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![felix07059](https://avatars.discourse-cdn.com/v4/letter/f/ecd19e/32.png) [@felix07059](https://discuss.elastic.co/u/felix07059)\
**Post date:** [April 15, 2014, 3:04pm UTC](https://discuss.elastic.co/t/search-pattern-with-a-forward-slash/17028/1 "2014-04-15T15:04:21Z")

</div>

Hi,

I have a set of data setting in elasticsearch, like  
{"symbol":"AUD/USD"},{"symbol":"HKD/USD"},{"symbol":"AUD/EUR"}... I would  
like to search for "AUD/USD". So the search query string will be "{  
"bool":{ "must":{ "query\_string":{ "query":"(symbol:AUD/USD)" } } } }". But  
the result I got looks that ES used "/" (forward slash) to search any  
symbol having "AUD" or "USD" instead of "AUD/USD". I tried with "\/" and I  
got a same result.

thanks,  
Felix

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f5ec93b6-f847-467c-8ab6-3b51d77ce499%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f5ec93b6-f847-467c-8ab6-3b51d77ce499%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [April 15, 2014, 3:18pm UTC](https://discuss.elastic.co/t/search-pattern-with-a-forward-slash/17028/2 "2014-04-15T15:18:23Z")

</div>

Make it a phrase query:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

or with the query\_string:

{  
"bool": {  
"must": {  
"query\_string": {  
"query": "(symbol:"AUD/USD")"  
}  
}  
}  
}

Dan  
On Tuesday, April 15, 2014 4:04:21 PM UTC+1, [felix...@gmail.com](mailto:felix...@gmail.com) wrote:

> Hi,
> 
> I have a set of data setting in elasticsearch, like  
> {"symbol":"AUD/USD"},{"symbol":"HKD/USD"},{"symbol":"AUD/EUR"}... I would  
> like to search for "AUD/USD". So the search query string will be "{  
> "bool":{ "must":{ "query\_string":{ "query":"(symbol:AUD/USD)" } } } }". But  
> the result I got looks that ES used "/" (forward slash) to search any  
> symbol having "AUD" or "USD" instead of "AUD/USD". I tried with "\/" and I  
> got a same result.
> 
> thanks,  
> Felix

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ec964f9b-932f-4404-a9a1-58f11b748d86%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ec964f9b-932f-4404-a9a1-58f11b748d86%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:35am UTC](https://discuss.elastic.co/t/search-pattern-with-a-forward-slash/17028/3 "2017-07-06T01:35:44Z")

</div>


