[aggregations] Is it possible to calculate fields based on multiple aggregations?

2014-06-25 Thread Mario Mueller
Given is a query: https://gist.github.com/xenji/a99342d3cfc5864ad6e4
The data: Tracking data from a website. Browser and Browser Version are 
available on the first level of the document as string values.

The goal:

* Get a term agg. over all browsers and nested over their versions (DONE)
* Get the overall count of docs that have a browser field filled (DONE)
* Calculate the percentile of the version related to the count of a 
browser. (Browser Firefox, Version 25.0 is 25% of all Firefox hits)
* Calculate the percentile of the browser related to the overall count (All 
Firefox hits are 15% of all hits)

The last two are driving me mad. Is this possible at all? I can do it in 
the application for sure, but I want to know if this is possible to be done 
in ES.

Any hints?

Regards,
Mario

-- 
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/4fb8-7e9d-49ce-a305-a0ded2a1ac65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: elasticsearch 1.2.1 plugin

2014-06-25 Thread Mario Mueller
Can you explain in more detail what you want to write? This greatly 
enhances your chance to get a valuable answer ;)

Am Dienstag, 24. Juni 2014 21:05:38 UTC+2 schrieb sri:

 Hello,

 I need to write a plugin for elasticsearch 1.2.1 but i was not able to 
 fine proper documentation or reference for that, i would be very grateful 
 if anyone would be able to guide me with the same.

 I have referred to the plugins of previous ES version but there are 
 changes in syntax between the version.

 Thanks and Regards
 Sri


-- 
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/d55ac4e2-ba70-45b8-9a85-0eccd1f26cbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A plugin to change the result set before sending it back to the http client

2014-06-06 Thread Mario Mueller
Et kütt wie et kütt ;) Das mit dem Koelsch geht klar, gibts auch hier in 
DUS.

Again thanks to all!

Am Freitag, 6. Juni 2014 09:09:39 UTC+2 schrieb Jörg Prante:

 I drink Kölsch only :) ävver et hätt noh immer joot jejange

 Greetings from Cologne!

 Jörg


 On Fri, Jun 6, 2014 at 7:14 AM, Mario Mueller ma...@xenji.com 
 javascript: wrote:

 You guys are totally awesome! Thanks a lot! If you ever visit Duesseldorf 
 drop me a line, I owe you a beer.

 @Brian:
 Interesting approach, but wouldn't this go against the initial no 
 additional proxy statement, if I got you right ..



 Am Donnerstag, 5. Juni 2014 19:45:33 UTC+2 schrieb Mario Mueller:

 Hey folks,

 I kindly ask for a hint to achieve the following thing:

 The goal is to deliver only a json array of source objects to the 
 client. The php app that sits on the other side uses JMS\Serializer to 
 deserialize the response into entities. At the moment the app needs to take 
 an overhead to derserialize it, extract the source and serialize it again. 
 Then the serialized stuff is passed to the entity deserializer. That's 
 really painful.

 I've found a thread that suggests a proxy in between to handle this type 
 of problem, but this is not possible in our env.

 The real question is: Is this achievable by writing a plugin? And if so, 
 what type of plugin? I've looked at the RestFilter, but I don't know if 
 this is the right way to go...

 Any hints are welcome!

 Regards,
 Mario

  -- 
 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 elasticsearc...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/b27db27a-b136-4a3b-81b5-16d60047540d%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/b27db27a-b136-4a3b-81b5-16d60047540d%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/d8c20589-1f4b-4b87-b140-ec7126e5bbe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


A plugin to change the result set before sending it back to the http client

2014-06-05 Thread Mario Mueller
Hey folks,

I kindly ask for a hint to achieve the following thing:

The goal is to deliver only a json array of source objects to the client. 
The php app that sits on the other side uses JMS\Serializer to deserialize 
the response into entities. At the moment the app needs to take an overhead 
to derserialize it, extract the source and serialize it again. Then the 
serialized stuff is passed to the entity deserializer. That's really 
painful.

I've found a thread that suggests a proxy in between to handle this type of 
problem, but this is not possible in our env.

The real question is: Is this achievable by writing a plugin? And if so, 
what type of plugin? I've looked at the RestFilter, but I don't know if 
this is the right way to go...

Any hints are welcome!

Regards,
Mario

-- 
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/6844c290-e7f8-46d7-b5b3-27cab18fb706%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A plugin to change the result set before sending it back to the http client

2014-06-05 Thread Mario Mueller
So, if I understood your approach in the right way ... I should build a new 
Rest Action like _search_and_return_source that proxies the original 
_search one?

I've already read those two articles and I've set up my development 
environment with the help of those ;)

Am Donnerstag, 5. Juni 2014 19:55:06 UTC+2 schrieb Ivan Brusic:

 If you are only modifying the REST API calls and not the Java API, such a 
 plugin should be easy. You are not creating a new type of action, merely 
 using the current search one, but changing the output format.

 Here are two tutorials on simple REST plugins:

 http://jprante.github.io/lessons/2012/03/27/Writing-a-simple-plugin-for-Elasticsearch.html
 http://blog.brusic.com/2011/09/create-pluggable-rest-endpoints-in.html

 Hopefully the content is not too old. Base the plugin around the 
 existing RestSearchAction, but in the handleRequest method, instead of 
 returning the results directly, you can modify them before.

 Cheers

 Ivan


 On Thu, Jun 5, 2014 at 10:45 AM, Mario Mueller ma...@xenji.com 
 javascript: wrote:

 Hey folks,

 I kindly ask for a hint to achieve the following thing:

 The goal is to deliver only a json array of source objects to the client. 
 The php app that sits on the other side uses JMS\Serializer to deserialize 
 the response into entities. At the moment the app needs to take an overhead 
 to derserialize it, extract the source and serialize it again. Then the 
 serialized stuff is passed to the entity deserializer. That's really 
 painful.

 I've found a thread that suggests a proxy in between to handle this type 
 of problem, but this is not possible in our env.

 The real question is: Is this achievable by writing a plugin? And if so, 
 what type of plugin? I've looked at the RestFilter, but I don't know if 
 this is the right way to go...

 Any hints are welcome!

 Regards,
 Mario

 -- 
 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 elasticsearc...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/6844c290-e7f8-46d7-b5b3-27cab18fb706%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/6844c290-e7f8-46d7-b5b3-27cab18fb706%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/8158ba2e-55e1-4c1b-b918-ee33000800a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A plugin to change the result set before sending it back to the http client

2014-06-05 Thread Mario Mueller
Hey Joerg,

I just need the whole content of the _source field like so:

[
   {
  HotelName: Plaka,
  ProductCode: 7050,
  objectId: 437-de,
  GroupId: 25223,
  readonly: false,
  lang: de,
  City: Athens
   },
   {
  HotelName: Hyatt at Fisherman's Wharf,
  ProductCode: 52397,
  objectId: 14479-de,
  GroupId: 25223,
  readonly: false,
  lang: de,
  City: San Francisco
   }
]

Those fields are not stored, but indexed. As I mentioned before, this 
source matches exactly to an entity structure in our application and we 
need the structure of the source document 1:1. If this is achievable by any 
other methods than a plugin, then I am totally fine with it.

Am Donnerstag, 5. Juni 2014 21:36:31 UTC+2 schrieb Jörg Prante:

 Just a quick question, do you just want to extract a field from the json 
 source?

 There are field filters and parameters for shaping such a JSON result, 
 maybe they can already help?

 Or can you give an example of the problem?

 Jörg



 On Thu, Jun 5, 2014 at 7:45 PM, Mario Mueller ma...@xenji.com 
 javascript: wrote:

 Hey folks,

 I kindly ask for a hint to achieve the following thing:

 The goal is to deliver only a json array of source objects to the client. 
 The php app that sits on the other side uses JMS\Serializer to deserialize 
 the response into entities. At the moment the app needs to take an overhead 
 to derserialize it, extract the source and serialize it again. Then the 
 serialized stuff is passed to the entity deserializer. That's really 
 painful.

 I've found a thread that suggests a proxy in between to handle this type 
 of problem, but this is not possible in our env.

 The real question is: Is this achievable by writing a plugin? And if so, 
 what type of plugin? I've looked at the RestFilter, but I don't know if 
 this is the right way to go...

 Any hints are welcome!

 Regards,
 Mario

 -- 
 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 elasticsearc...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/6844c290-e7f8-46d7-b5b3-27cab18fb706%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/6844c290-e7f8-46d7-b5b3-27cab18fb706%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/b9a6e43f-35ec-4275-9a29-417552e1d94f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Replacing the GetResult / SearchResult impl. via DI?

2014-04-24 Thread Mario Mueller
Hey folks,

I'm using the Java client on an embedded running server (on a Wildfly 8, 
standalone-full). To make my life easier for my usecase, I want to 
implement a Result that is capable of using my gson provider (CDI) together 
with a classname to get me the source not only as string, but as my bean of 
choice. Is there any common way to overload the result set (maybe using 
guice?) to make this possible to implement?

The hard way would be to write a delegating proxy for each step ... this 
would work, but feels clumsy and is not a good architectural decision at 
all.

Thanks for any hint!
Mario 

-- 
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/60aca4c9-8bea-49aa-a3fc-732f67cb39fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.