How to search such values :- 1/2"-12

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to search such values :- 1/2"-12

mohit.Kumar
Hello Folks,

I have a such data

doc1 ->  { "Data" : "1/2"-12"}
doc2 ->  { "Data" : "3/4"-22"}
doc3 ->  { "Data" : "1/8"-42"}
doc4 ->  { "Data" : "4/13"-2"}
doc5 ->  { "Data" : "13/24"-27"} 

where data is mapped as a string. {"Data":{"type":"String"}}

I am using following query for search :- 

{"query_string": {"query": "Data:1\\/2\\\"-12"}}

but I am getting irrelevant response.
 
Can you please suggest me some ways to track it..

Thanks in advance...!!

Thanks 
Mohit




--
Please update your bookmarks! We have moved to https://discuss.elastic.co/
---
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAK6eDKfjzpwqUNuCgox%3Dn5a8xTrBG5C%2B4uKOv9%2B4xCNGPLokQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to search such values :- 1/2"-12

Anusha
You can use prefix query hope so.

 "query": {
      "prefix": {
         "Data": {
            "value": "1/2"-12"
         }
      }
   }

On Thursday, June 4, 2015 at 6:39:10 PM UTC+5:30, Mohit Kumar Yadav wrote:
Hello Folks,

I have a such data

doc1 ->  { "Data" : "1/2"-12"}
doc2 ->  { "Data" : "3/4"-22"}
doc3 ->  { "Data" : "1/8"-42"}
doc4 ->  { "Data" : "4/13"-2"}
doc5 ->  { "Data" : "13/24"-27"} 

where data is mapped as a string. {"Data":{"type":"String"}}

I am using following query for search :- 

{"query_string": {"query": "Data:1\\/2\\\"-12"}}

but I am getting irrelevant response.
 
Can you please suggest me some ways to track it..

Thanks in advance...!!

Thanks 
Mohit




--
Please update your bookmarks! We have moved to https://discuss.elastic.co/
---
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d816ad10-2acc-4122-8d89-072a823df5b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.