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"
]
}
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.
You'd probably need to first index that field as not analyzed, or something
that does not strip the quotes. And then use the match query, like for
example
how can you use match_phrase to find all available phrases ? The goal is not to find specific phrases but text inside the quotation symbols. Could you be more specific please? I know that it's been a long time since the last answer in the topic, but I could use some help
This:
.setQuery(QueryBuilders.matchPhraseQuery("body", ""(.*?)""))
returns nothing for me.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.