AgentV  
                (AgentV)
               
                 
              
                  
                    September 14, 2014,  6:45pm
                   
                   
              1 
               
             
            
              Hello
I need to use the top hits aggregation 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html  
for a grouping feature. The aggregation should be applied on nested fields.
e.g. My nested field is F with path P.
Would appreciate it if someone can share an example to create a top hits 
aggregation query for this scenario.
Thanks !
-- 
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/1fedd65a-c7af-407b-a1db-cd1e5c0918d7%40googlegroups.com . 
For more options, visit https://groups.google.com/d/optout .
             
            
               
               
               
            
            
           
          
            
              
                mvg  
                (Martijn Van Groningen)
               
              
                  
                    September 15, 2014,  6:48am
                   
                   
              2 
               
             
            
              Hi,
In that case you would need to wrap a terms agg in a nested aggregation 
(with the desired path) and a top_hits inside that terms aggregation. 
Unfortunately the top_hits aggregation doesn't yet work inside a nested 
aggregation. However work is being done that will add this support:
  
  
    
    
  
      
    
      elastic:master ← martijnvg:improvements/top_hits_in_nested
    
      
        
          opened 01:02PM - 05 Aug 14 UTC 
        
        
        
       
   
 
  
    At the moment the `top_hits` aggregation fails if it is being put in a nested or…  reverse_nested aggregations. This PR add proper support for nested inner objects being emitted as hits in the `top_hits` aggregator. All the known fetch phase features are supported.
This PR adds fetch infrastructure to get #3022 in as well. 
   
   
  
    
    
  
  
 
Martijn
On 14 September 2014 20:45, AgentV coder.agentv@gmail.com  wrote:
Hello
I need to use the top hits aggregation 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html  
for a grouping feature. The aggregation should be applied on nested fields.
e.g. My nested field is F with path P.
Would appreciate it if someone can share an example to create a top hits 
aggregation query for this scenario.
Thanks !
-- 
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/1fedd65a-c7af-407b-a1db-cd1e5c0918d7%40googlegroups.com  
https://groups.google.com/d/msgid/elasticsearch/1fedd65a-c7af-407b-a1db-cd1e5c0918d7%40googlegroups.com?utm_medium=email&utm_source=footer  
. 
For more options, visit https://groups.google.com/d/optout .
 
-- 
Met vriendelijke groet,
Martijn van Groningen
-- 
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/CA%2BA76TwbOKqvHOfGU6zgUSzZE8wXtsodnDroJa3OUktKh%3DM4Dg%40mail.gmail.com . 
For more options, visit https://groups.google.com/d/optout .