Highlighting a text_phrase_prefix query

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true' -
d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Which version are you using?

On Tue, Aug 9, 2011 at 7:24 AM, William Schwarzenbach wmschwa@gmail.comwrote:

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true' -
d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Hi Shay,
Version is 0.16.2. I'm guessing it's time to upgrade.
Thanks,
Will

On Tue, Aug 9, 2011 at 2:24 AM, Shay Banon kimchy@gmail.com wrote:

Which version are you using?

On Tue, Aug 9, 2011 at 7:24 AM, William Schwarzenbach wmschwa@gmail.comwrote:

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true' -
d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Yea, it should be fixed in 0.17.

On Tue, Aug 9, 2011 at 8:48 PM, William Schwarzenbach wmschwa@gmail.comwrote:

Hi Shay,
Version is 0.16.2. I'm guessing it's time to upgrade.
Thanks,
Will

On Tue, Aug 9, 2011 at 2:24 AM, Shay Banon kimchy@gmail.com wrote:

Which version are you using?

On Tue, Aug 9, 2011 at 7:24 AM, William Schwarzenbach wmschwa@gmail.comwrote:

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true' -
d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Just tried on 0.17.4. Same behavior. I don't think the release notes mention
this problem.

Just a note: I've tried with both highlighters by specifying term_vector on
the field in question and by leaving it unspecified.

-Will

On Tue, Aug 9, 2011 at 11:23 AM, Shay Banon kimchy@gmail.com wrote:

Yea, it should be fixed in 0.17.

On Tue, Aug 9, 2011 at 8:48 PM, William Schwarzenbach wmschwa@gmail.comwrote:

Hi Shay,
Version is 0.16.2. I'm guessing it's time to upgrade.
Thanks,
Will

On Tue, Aug 9, 2011 at 2:24 AM, Shay Banon kimchy@gmail.com wrote:

Which version are you using?

On Tue, Aug 9, 2011 at 7:24 AM, William Schwarzenbach <wmschwa@gmail.com

wrote:

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true' -
d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Can you gist a recreation then? Simpler for me to get started at looking at
it.

On Tue, Aug 9, 2011 at 9:33 PM, William Schwarzenbach wmschwa@gmail.comwrote:

Just tried on 0.17.4. Same behavior. I don't think the release notes
mention this problem.

Just a note: I've tried with both highlighters by specifying term_vector on
the field in question and by leaving it unspecified.

-Will

On Tue, Aug 9, 2011 at 11:23 AM, Shay Banon kimchy@gmail.com wrote:

Yea, it should be fixed in 0.17.

On Tue, Aug 9, 2011 at 8:48 PM, William Schwarzenbach wmschwa@gmail.comwrote:

Hi Shay,
Version is 0.16.2. I'm guessing it's time to upgrade.
Thanks,
Will

On Tue, Aug 9, 2011 at 2:24 AM, Shay Banon kimchy@gmail.com wrote:

Which version are you using?

On Tue, Aug 9, 2011 at 7:24 AM, William Schwarzenbach <
wmschwa@gmail.com> wrote:

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true'

d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Gisted a script:

should work as an end-to-end repro of the issue.

Thanks,
Will

On Tue, Aug 9, 2011 at 1:41 PM, Shay Banon kimchy@gmail.com wrote:

Can you gist a recreation then? Simpler for me to get started at looking at
it.

On Tue, Aug 9, 2011 at 9:33 PM, William Schwarzenbach wmschwa@gmail.comwrote:

Just tried on 0.17.4. Same behavior. I don't think the release notes
mention this problem.

Just a note: I've tried with both highlighters by specifying term_vector
on the field in question and by leaving it unspecified.

-Will

On Tue, Aug 9, 2011 at 11:23 AM, Shay Banon kimchy@gmail.com wrote:

Yea, it should be fixed in 0.17.

On Tue, Aug 9, 2011 at 8:48 PM, William Schwarzenbach <wmschwa@gmail.com

wrote:

Hi Shay,
Version is 0.16.2. I'm guessing it's time to upgrade.
Thanks,
Will

On Tue, Aug 9, 2011 at 2:24 AM, Shay Banon kimchy@gmail.com wrote:

Which version are you using?

On Tue, Aug 9, 2011 at 7:24 AM, William Schwarzenbach <
wmschwa@gmail.com> wrote:

I'm trying to get a quick and dirty autocomplete implementation
working and thought a decent approach would be to fetch the
highlighted phrase for a prefix phrase query and be done with it.
However, no highlights are returned for a text_prefix_phrase query. An
example curl:

curl 'http://localhost:9200/test_index/test_type/_search?pretty=true'

d
'{
"highlight":{
"fields": {
"name": {}
}
},
"query":{
"text_phrase_prefix":{
"name": "Walla Wa"
}
}}'

This returns a non-empty result with no highlights. On the other hand,
a text_phrase query returns the highlights.
Any help would be appreciated.

Cheers,
Will

Hello,

I have the same problems than William.
I'm working the elasticsearch version 0.19.4.
Is there an error on his script ? or there's a feature not yet implemented ?

Thanks,
Christophe.

On Tuesday, August 9, 2011 11:29:06 PM UTC+2, William Schwarzenbach wrote:

Gisted a script:

This is a script to reproduce a highlighting issue with the text_phrase_prefix query · GitHub

should work as an end-to-end repro of the issue.

Thanks,
Will

Hi there,

I experience the same problem using the current 20.2.0 release. Is this a
bug or is there a conceptual problem?

Thanks,
Thomas

--

I had the same problem with 0.20.2, which disappeared after updating to the
current 0.20.4 release.

Cheers,
Martin

On Friday, January 25, 2013 12:01:08 AM UTC+1, Thomas Buechner wrote:

Hi there,

I experience the same problem using the current 20.2.0 release. Is this a
bug or is there a conceptual problem?

Thanks,
Thomas

--
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.
For more options, visit https://groups.google.com/groups/opt_out.