Re: aggregation of hierchical elements possible?

2014-09-02 Thread Markus Breuer
Helli Vineeth,

thx for your response. Your proposal 1. seems to be similar to the 
path-tokenizer, which I used, isn't it?

"settings" : {
 "index" : {
 "analysis" : {
 "analyzer" : {
 "path-analyzer" : {
 "type" : "custom"
 "tokenizer" : "path-tokenizer"
 }
 }
 "tokenizer" : {
 "path-tokenizer" : {
 "type" : "path_hierarchy"
 "delimiter" : "/"
 }
 }
 }
 }
}

But when using the term-aggregation, the result is not correct. The 
following query should do an aggregation per folder and sum the length 
of all files in this folder and subfolders. The query returns some 
result but the result seems not to be complete. Can you explain in which 
way you would apply your proposal at 3.?

{
 "aggs" : {
 "file_count" : {
 "terms" : {
 "field" : "path",
 "order" : {
 "_term" : "asc"
 }
 },
 "aggs" : {
 "file_size" : {
 "sum" : {
 "field" : "length"
 }
 }
 }
 }
 },
 "size" : 0
}

These are my mappings:

{
 "properties" : {
 "path" : {
 "type" : "string",
 "analyzer" : "path-analyzer"
 },
 "full_path" : {
 "type" : "string",
 "index" : "not_analyzed"
 },
 "is_dir" : {
 "type" : "boolean"
 }
 }
}

regards,
markus



> Hello Markus ,
>
> I cant seem to think of any straight method , but then you can try the 
> following
>
>  1. Apply source transform script to convert /a/b/c => [ /a , /a/b ,
> /a/b/c ] -
> 
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-transform.html#mapping-transform
>  2. Now apply normal term aggregation.
>  3. But then your query on this field will also match /a , /a/b also ,
> so go for a raw field too
>
> Thanks
>   Vineeth
>
>
> On Mon, Sep 1, 2014 at 9:21 PM, skippi1 <[hidden email] 
> > wrote:
>
> The index has a field named "path" which contains the canonical
> file name,
> e.g.:
>
> /a/file1
> /a/file2
> /a/b/file3
>
> Is it possible to create an bucket aggregation to summarize all
> file per
> path including subfolders?
>
> Something like that:
>
> /a => 3 files
> /a/b => 1 file
>
> regars,
> markus
>
>
>
>
>
> --
> View this message in context:
> 
> http://elasticsearch-users.115913.n3.nabble.com/aggregation-of-hierchical-elements-possible-tp4062768.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 [hidden email]
> .
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/elasticsearch/1409586703001-4062768.post%40n3.nabble.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> 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 [hidden email] 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nN04%3DjEborsm%3D%3D_N6Yt8vSCN95WJ6Ka4gJGqHRXSJ2Bw%40mail.gmail.com
>  
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> 
> If you reply to this email, your message will be added to the 
> discussion below:
> http://elasticsearch-users.115913.n3.nabble.com/aggregation-of-hierchical-elements-possible-tp4062768p4062817.html
>  
>
> To unsubscribe from aggregation of hierchical elements possible?, 
> click here 
> .
> NAML 
> 
>  
>





--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/aggregation-of-hierchical-el

Re: how to use aggregations with filter?

2014-09-01 Thread Markus Breuer
Can someone see this post on mailinglist? I see "currently not accepted by
mailing list", but I am subribed to it.



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/how-to-use-aggregations-with-filter-tp4062464p4062773.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1409587665257-4062773.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.