Hello, I would like to know what is the best way to search for those hits
which have some text wrapped in double quotes.
As an example, this is one of the items I have
"_index": "posts",
"_type": "post",
"_id": "2915129",
"_score": 1,
"fields": {
"text": [
"\"Some times I'm not even sure I believe the things I
can see.\"-John"
]
}
Right now I'm trying to use this query
POST /posts/_search
{
"query": {
"query_string": {
"query": "text:/(?:.*(\"[^\"]+\")).+/"
}
}
}
But I have the next error IllegalArgumentException[expected '\"' at
position 17
I have tried different solutions but with no success. I know it is tricky
because of the double quotes since 1. they are reserved characters inside a
regex, 2. They have to be escaped because is a json in the query, 3. Are
the double quotes scape in the elasticsearch storage? 4. Should I look for
\" instead of just "
Actually I'm kind of lost and I think I have tried almost all
possibilities. I was making this in a MySQL database before using this
regex
text.match(/"(?:[^"\\]|\\.)*"/)
but it doesn't work either.
Thanks for your help!
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/ab192a94-736f-42e4-8eae-118d9656321d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.