Hello, thanks for your response, but in fact we are trying to pass the
query string to Elasticsearch, not processing local strings.
Elastic search makes highlight for you adding start and end tags to
it.
On Mon, 2011-10-10 at 07:16 -0700, Alexander Nemsadze wrote:
Hello
We want to get the functionality of text_phrase_prefix but with
highlights. To search exact matching of phrase without ending last
word.
Any suggestions implementing this?
A simple regex on the the highlighted phrase would work, eg, in Perl
(assuming your highlighting uses tags):
On Mon, 2011-10-10 at 07:35 -0700, Alexander Nemsadze wrote:
Hello, thanks for your response, but in fact we are trying to pass the
query string to Elasticsearch, not processing local strings.
Elastic search makes highlight for you adding start and end tags to
it.
Hi Alexander
My regex was for post-processing results from elasticsearch to achieve
what you want, ie instead of a search for "lang" returning
Thanks for that solution, but my problem is that I have no "a language in common use" highlighted text returned from
elasticsearch, as text_phrase does not search anything when entering
part of the word.
text_phrase_prefix works perfectly for me, except highlight, no
highlight is returned when I enter one word and half part of the
second word, for example - Steve Jo - will return entry, but no
highlight part exists in response JSON. If I enter - Ste - everything
is OK.
On Mon, 2011-10-10 at 07:35 -0700, Alexander Nemsadze wrote:
Hello, thanks for your response, but in fact we are trying to pass the
query string to Elasticsearch, not processing local strings.
Elastic search makes highlight for you adding start and end tags to
it.
Hi Alexander
My regex was for post-processing results from elasticsearch to achieve
what you want, ie instead of a search for "lang" returning
text_phrase_prefix works perfectly for me, except highlight, no
highlight is returned when I enter one word and half part of the
second word, for example - Steve Jo - will return entry, but no
highlight part exists in response JSON. If I enter - Ste - everything
is OK.
Ah right - apologies. I missed the fact that highlighting doesn't work
at all with text_phrase_prefix.
I don't know why this is the case. I suggest opening an issue
To explain in one more way, we want to get result elasticsearch to
search for us exactly as database LIKE 'something mor%' query does and
with highlights
text_phrase_prefix works perfectly for me, except highlight, no
highlight is returned when I enter one word and half part of the
second word, for example - Steve Jo - will return entry, but no
highlight part exists in response JSON. If I enter - Ste - everything
is OK.
Ah right - apologies. I missed the fact that highlighting doesn't work
at all with text_phrase_prefix.
I don't know why this is the case. I suggest opening an issue
Can you have term vectors stored for the field you highlight on, and see if
it helps? You will need to reindex the data. Storing term vectors will cause
a different highlighting implementation to be used (see here: Elasticsearch Platform — Find real-time answers at scale | Elastic.
To explain in one more way, we want to get result elasticsearch to
search for us exactly as database LIKE 'something mor%' query does and
with highlights
text_phrase_prefix works perfectly for me, except highlight, no
highlight is returned when I enter one word and half part of the
second word, for example - Steve Jo - will return entry, but no
highlight part exists in response JSON. If I enter - Ste - everything
is OK.
Ah right - apologies. I missed the fact that highlighting doesn't work
at all with text_phrase_prefix.
I don't know why this is the case. I suggest opening an issue
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.