Highlighting on all fields

Hi,

I'm new to elastic search and am wondering if there is a way to highlight on all fields.

Looks like highlighting requires me to explicitly specify the field names.
My understanding is that if I want to highlight on all fields, I will have to use _all but that requires me to store the _all field that will increase index size and requires some mappings for _all.

Is there any way to highlight on all fields without having to store extra data or mapping?

Any sample query will be appreciated.
Thanks

1 Like

You need to specify the field to highlight on, or, highlight the _all field
(Elasticsearch Platform — Find real-time answers at scale | Elastic).

On Wed, Jan 11, 2012 at 9:42 PM, chimingc jchen@sugarcrm.com wrote:

Hi,

I'm new to Elasticsearch and am wondering if there is a way to highlight
on
all fields.

Looks like highlighting requires me to explicitly specify the field names.
My understanding is that if I want to highlight on all fields, I will have
to use _all but that requires me to store the _all field that will increase
index size and requires some mappings for _all.

Is there any way to highlight on all fields without having to store extra
data or mapping?

Any sample query will be appreciated.
Thanks

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Highlighting-on-all-fields-tp3651620p3651620.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

1 Like

Hi

you can also do like this. it worked like charm for me: use "*" instead of
"_all"

POST 123821/Encounters/_search
{
"query": {
"query_string": {
"query": "Test*"
}
},
"highlight" : {
"fields" : {
"*" : {}
}
}
}

On Thursday, 12 January 2012 01:12:59 UTC+5:30, Jimmy Chen wrote:

Hi,

I'm new to Elasticsearch and am wondering if there is a way to highlight
on
all fields.

Looks like highlighting requires me to explicitly specify the field names.
My understanding is that if I want to highlight on all fields, I will have
to use _all but that requires me to store the _all field that will increase
index size and requires some mappings for _all.

Is there any way to highlight on all fields without having to store extra
data or mapping?

Any sample query will be appreciated.
Thanks

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Highlighting-on-all-fields-tp3651620p3651620.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

--
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/77d50d6f-1179-48c5-9edd-28c36237d1c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

3 Likes