Highlighting a field with contents of another field in a single result


(project2501) #1

Hi,
Is it possible to highlight a field with the tokens/terms/words contained
in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Nik Everett) #2

Do you mean you want to highlight a field you aren't matching? If so you can require_field_match or highlight_query. The former is simpler but gives you less control.

Sent from my iPhone

On Dec 12, 2013, at 6:47 PM, project2501 darreng5150@gmail.com wrote:

Hi,
Is it possible to highlight a field with the tokens/terms/words contained in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/37D03FED-AB7E-4372-B5B9-3978F467A110%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(project2501) #3

Yes. Highlight a field I'm not matching but using the contents of a matched
field as the terms. I tried highlight_query but it didn't seem to do this.
Still trying, but needing some tips.

On Thursday, December 12, 2013 6:57:16 PM UTC-5, Nikolas Everett wrote:

Do you mean you want to highlight a field you aren't matching? If so you
can require_field_match or highlight_query. The former is simpler but
gives you less control.

Sent from my iPhone

On Dec 12, 2013, at 6:47 PM, project2501 <darre...@gmail.com <javascript:>>
wrote:

Hi,
Is it possible to highlight a field with the tokens/terms/words
contained in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5d3c13fb-0490-489a-a81b-fe3ae25867ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Nik Everett) #4

Have a look at
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#field-match

On Thu, Dec 12, 2013 at 7:29 PM, project2501 darreng5150@gmail.com wrote:

Yes. Highlight a field I'm not matching but using the contents of a
matched field as the terms. I tried highlight_query but it didn't seem to
do this. Still trying, but needing some tips.

On Thursday, December 12, 2013 6:57:16 PM UTC-5, Nikolas Everett wrote:

Do you mean you want to highlight a field you aren't matching? If so you
can require_field_match or highlight_query. The former is simpler but
gives you less control.

Sent from my iPhone

On Dec 12, 2013, at 6:47 PM, project2501 darre...@gmail.com wrote:

Hi,
Is it possible to highlight a field with the tokens/terms/words
contained in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

--
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 elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%
40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5d3c13fb-0490-489a-a81b-fe3ae25867ea%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0Bzy4%3DKP%2B9M40%3DmFGfJSQAHqTZ_%2BOBYkLrQCD6b6exYA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(project2501) #5

I got it to work. Had to change a field mapping to support it. Thanks
fellas.

On Thursday, December 12, 2013 7:36:31 PM UTC-5, Nikolas Everett wrote:

Have a look at
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#field-match

On Thu, Dec 12, 2013 at 7:29 PM, project2501 <darre...@gmail.com<javascript:>

wrote:

Yes. Highlight a field I'm not matching but using the contents of a
matched field as the terms. I tried highlight_query but it didn't seem to
do this. Still trying, but needing some tips.

On Thursday, December 12, 2013 6:57:16 PM UTC-5, Nikolas Everett wrote:

Do you mean you want to highlight a field you aren't matching? If so
you can require_field_match or highlight_query. The former is simpler but
gives you less control.

Sent from my iPhone

On Dec 12, 2013, at 6:47 PM, project2501 darre...@gmail.com wrote:

Hi,
Is it possible to highlight a field with the tokens/terms/words
contained in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

--
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 elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%
40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5d3c13fb-0490-489a-a81b-fe3ae25867ea%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/eb04c1bf-ef19-43ec-a41a-d33edabbfc32%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(project2501) #6

Spoke too soon. I guess this doesn't work with fields that were expressed
in a filter..... ??

On Thursday, December 12, 2013 8:26:15 PM UTC-5, project2501 wrote:

I got it to work. Had to change a field mapping to support it. Thanks
fellas.

On Thursday, December 12, 2013 7:36:31 PM UTC-5, Nikolas Everett wrote:

Have a look at
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#field-match

On Thu, Dec 12, 2013 at 7:29 PM, project2501 darre...@gmail.com wrote:

Yes. Highlight a field I'm not matching but using the contents of a
matched field as the terms. I tried highlight_query but it didn't seem to
do this. Still trying, but needing some tips.

On Thursday, December 12, 2013 6:57:16 PM UTC-5, Nikolas Everett wrote:

Do you mean you want to highlight a field you aren't matching? If so
you can require_field_match or highlight_query. The former is simpler but
gives you less control.

Sent from my iPhone

On Dec 12, 2013, at 6:47 PM, project2501 darre...@gmail.com wrote:

Hi,
Is it possible to highlight a field with the tokens/terms/words
contained in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

--
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 elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%
40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5d3c13fb-0490-489a-a81b-fe3ae25867ea%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/26bd46c1-ba8f-453d-a6c8-91f7906690aa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Nik Everett) #7

Looks like it, yes. You can use the highlight_query to rewrite the filter
as a clause in a bool query, I suppose.

On Thu, Dec 12, 2013 at 9:36 PM, project2501 darreng5150@gmail.com wrote:

Spoke too soon. I guess this doesn't work with fields that were expressed
in a filter..... ??

On Thursday, December 12, 2013 8:26:15 PM UTC-5, project2501 wrote:

I got it to work. Had to change a field mapping to support it. Thanks
fellas.

On Thursday, December 12, 2013 7:36:31 PM UTC-5, Nikolas Everett wrote:

Have a look at http://www.elasticsearch.org/guide/en/elasticsearch/
reference/current/search-request-highlighting.html#field-match

On Thu, Dec 12, 2013 at 7:29 PM, project2501 darre...@gmail.com wrote:

Yes. Highlight a field I'm not matching but using the contents of a
matched field as the terms. I tried highlight_query but it didn't seem to
do this. Still trying, but needing some tips.

On Thursday, December 12, 2013 6:57:16 PM UTC-5, Nikolas Everett wrote:

Do you mean you want to highlight a field you aren't matching? If so
you can require_field_match or highlight_query. The former is simpler but
gives you less control.

Sent from my iPhone

On Dec 12, 2013, at 6:47 PM, project2501 darre...@gmail.com wrote:

Hi,
Is it possible to highlight a field with the tokens/terms/words
contained in another field in the same match?

I want to search on FieldA: [ * TO * ]

and highlight in field text: with tokens from FieldA for each document.

thanks for any tips.

--
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 elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/9797931a-05dd-43d1-8a44-67db959c6035%40goo
glegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/5d3c13fb-0490-489a-a81b-fe3ae25867ea%
40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/26bd46c1-ba8f-453d-a6c8-91f7906690aa%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0XhpKWOEnhvZvVm5%2BeK8SKQgaOtMSV8HUNq8TW8FCdFA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #8