You can use a multi-match query:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html
or copy all the fields you are interested in into a new field at index time
using copy_to:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#copy-to

On Fri, Mar 6, 2015 at 1:02 AM, Sagar Shah <[email protected]> wrote:

> Hello everyone,
> Here's my sample data going into elastic Search.
>
> {
>    "date_time_utc": "2014-01-01 01:01:01.000",
>    "details": "Details of the event",
>    "tracking_id": "Message Tracking Id",
>    "enterprise_application": "ENTP APP",
>    "log_level": "DEBUG",
>    "application_id": "342-34-254",
>    "source": "Source",
>    "log_code": "MDG.00.05",
>    "host": "127.0.0.1",
>    "context":
>    {
>    "A": "123",
>    "B": "456",
>    "C": "789"
>    }
> }
>
>
> When I am preparing for a search request, I am finding some issue.
> Basically, I need a capability to search a user input across all the
> elements of nested object "context".
> Context might have nested fields under it on the fly. So I need some kind
> of wild card operation of the fields itself like (context.*).
>
> I found one way, but that searches on specific field within context like
> given below.
>
> "nested": {
> "path": "context",
> "filter": {
> "bool": {
> "must": [
> { "term": { "context.A: "0432" } }
> ]
> }
> }
> }
>
> Is there a way to search a user input across all the fields under context
> nested element? I do not wish to search through rest of the fields.
>
> I would prefer filter over query here.
>
> Please advise.
>
> Appreciate your inputs!
>
> Regards,
> Sagar Shah
>
>
>  --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/5e04b543-9275-4bda-8696-068dd723b1d8%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/5e04b543-9275-4bda-8696-068dd723b1d8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adrien Grand

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7SrWzZpRX5UoJi16m3N1knrxSEH%2BU%3D9cK%3D_8jmSqmeeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to