Hi,
Am using fields with nested type, in the mappings I kept for column1 and 
column2 as nested type fields..

I am using the following query to get the top hits:

GET partsfilter/partsfilter_type/_search
{
    "size": 10, 
     "query" : {
        "match" : { "description" : "abc" }
    },
    "aggs" : {
        "column1" : {
            "nested" : {
                "path" : "column1"
            },
            "aggs" : {
               "col1_agg":
               {
                   "terms":
                   {
                       "field":"column1.@key",
                       "size":0
                   },
                   "aggs":
                   {
                       "top":
                       {
                           "top_hits":
                           {
                               "size":1
                           }
                       }
                   }
               }
            }
        }
    }
}

This is throwing  *SearchPhaseExecutionException[Failed to execute phase 
[query]  exception. when* am removing top_hits aggs it is working fine.
how to write a top_hits query to work for the above case..

-- 
Please update your bookmarks! We have moved to https://discuss.elastic.co/
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1a55439f-5099-4cdc-9c8e-20866fd4533e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to