Custom facet and elastic search facet plugin

Hi All,

I am trying to build a new facet for my requirement but could not find a
way to plugin my facet in elastic search.

I am using elastic search 0.90.1 version.

What I did so far;

  1. Created a facet extending the Facet.
  2. Extended the facetbuilder with returning the new custom facet
    builder.
  3. Create the parser , executor and other dependent classes.

When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom facet
needs to added there.

I am hoping after I add the custom parser to *FacetModule, *it would get
added to list and start working.

But my requirement is to add the custom facet as separate project/jar.
This way I would not be modifying the existing code, would be able to
update elastic search without any issues. I have looked through the forum
but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

When you create a plugin, you have access to all the existing modules via
the onModule methods. You can add your facet parser at this point. Some
pseudo code:

public class MyFacetPlugin extends AbstractPlugin {
...
public void onModule(FacetModule module) {
module.addFacetProcessor(MyFacetParser.class);
MyClusterFacet.registerStreams();
}
}

On Wed, Jul 3, 2013 at 10:38 AM, Amit Singh amitsingh.kec@gmail.com wrote:

Hi All,

I am trying to build a new facet for my requirement but could not find a
way to plugin my facet in Elasticsearch.

I am using Elasticsearch 0.90.1 version.

What I did so far;

  1. Created a facet extending the Facet.
  2. Extended the facetbuilder with returning the new custom facet
    builder.
  3. Create the parser , executor and other dependent classes.

When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom
facet needs to added there.

I am hoping after I add the custom parser to *FacetModule, *it would get
added to list and start working.

But my requirement is to add the custom facet as separate project/jar.
This way I would not be modifying the existing code, would be able to
update Elasticsearch without any issues. I have looked through the forum
but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks Ivan for the reply.

I am pretty new to writing plugin for Elasticsearch.
I will try to plugin my facet as suggested by you.

I have few questions;

  1. But how will the plugin be part of Elasticsearch.
  2. Adding the custom project/jar to the lib of Elasticsearch work.
  3. Or the project/jar needs to added differently to the class-path of
    Elasticsearch.
  4. I have added a new TermsStatsStringFacetMulti internal facet.
  5. How will the new streams be added to TransportFacetModule.
  6. As it does not allow a hook point.

Thanks
Amit

On Wednesday, July 3, 2013 11:08:33 PM UTC+5:30, Amit Singh wrote:

Hi All,

I am trying to build a new facet for my requirement but could not find a
way to plugin my facet in Elasticsearch.

I am using Elasticsearch 0.90.1 version.

What I did so far;

  1. Created a facet extending the Facet.
  2. Extended the facetbuilder with returning the new custom facet
    builder.
  3. Create the parser , executor and other dependent classes.

When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom
facet needs to added there.

I am hoping after I add the custom parser to *FacetModule, *it would get
added to list and start working.

But my requirement is to add the custom facet as separate project/jar.
This way I would not be modifying the existing code, would be able to
update Elasticsearch without any issues. I have looked through the forum
but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

You need to have this kind of file in your jar:

Elasticsearch will load it from /plugins/yourpluginname/yourpluginjar when you start the node.

Does it help?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:19, Amit Singh amitsingh.kec@gmail.com a écrit :

Thanks Ivan for the reply.

I am pretty new to writing plugin for Elasticsearch.
I will try to plugin my facet as suggested by you.

I have few questions;
But how will the plugin be part of Elasticsearch.
Adding the custom project/jar to the lib of Elasticsearch work.
Or the project/jar needs to added differently to the class-path of Elasticsearch.
I have added a new TermsStatsStringFacetMulti internal facet.
How will the new streams be added to TransportFacetModule.
As it does not allow a hook point.
Thanks
Amit

On Wednesday, July 3, 2013 11:08:33 PM UTC+5:30, Amit Singh wrote:

Hi All,

I am trying to build a new facet for my requirement but could not find a way to plugin my facet in Elasticsearch.

I am using Elasticsearch 0.90.1 version.

What I did so far;

Created a facet extending the Facet.
Extended the facetbuilder with returning the new custom facet builder.
Create the parser , executor and other dependent classes.
When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom facet needs to added there.

I am hoping after I add the custom parser to FacetModule, it would get added to list and start working.

But my requirement is to add the custom facet as separate project/jar. This way I would not be modifying the existing code, would be able to update Elasticsearch without any issues. I have looked through the forum but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I add to this that you could be interested in looking at https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/plugins/PluginsService.java?source=cc#L397

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:42, David Pilato david@pilato.fr a écrit :

You need to have this kind of file in your jar:

Elasticsearch will load it from /plugins/yourpluginname/yourpluginjar when you start the node.

Does it help?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:19, Amit Singh amitsingh.kec@gmail.com a écrit :

Thanks Ivan for the reply.

I am pretty new to writing plugin for Elasticsearch.
I will try to plugin my facet as suggested by you.

I have few questions;
But how will the plugin be part of Elasticsearch.
Adding the custom project/jar to the lib of Elasticsearch work.
Or the project/jar needs to added differently to the class-path of Elasticsearch.
I have added a new TermsStatsStringFacetMulti internal facet.
How will the new streams be added to TransportFacetModule.
As it does not allow a hook point.
Thanks
Amit

On Wednesday, July 3, 2013 11:08:33 PM UTC+5:30, Amit Singh wrote:

Hi All,

I am trying to build a new facet for my requirement but could not find a way to plugin my facet in Elasticsearch.

I am using Elasticsearch 0.90.1 version.

What I did so far;

Created a facet extending the Facet.
Extended the facetbuilder with returning the new custom facet builder.
Create the parser , executor and other dependent classes.
When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom facet needs to added there.

I am hoping after I add the custom parser to FacetModule, it would get added to list and start working.

But my requirement is to add the custom facet as separate project/jar. This way I would not be modifying the existing code, would be able to update Elasticsearch without any issues. I have looked through the forum but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks David,

I will hook the plugin as suggested by you and let you know of any other
issues/concerns.

Thanks
Amit

On Thursday, July 4, 2013 12:25:56 AM UTC+5:30, David Pilato wrote:

I add to this that you could be interested in looking at
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/plugins/PluginsService.java?source=cc#L397

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:42, David Pilato <da...@pilato.fr <javascript:>> a
écrit :

You need to have this kind of file in your jar:

https://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/resources/es-plugin.properties

Elasticsearch will load it from /plugins/yourpluginname/yourpluginjar when
you start the node.

Does it help?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:19, Amit Singh <amitsi...@gmail.com <javascript:>> a
écrit :

Thanks Ivan for the reply.

I am pretty new to writing plugin for Elasticsearch.
I will try to plugin my facet as suggested by you.

I have few questions;

  1. But how will the plugin be part of Elasticsearch.
  2. Adding the custom project/jar to the lib of Elasticsearch work.
  3. Or the project/jar needs to added differently to the class-path of
    Elasticsearch.
  4. I have added a new TermsStatsStringFacetMulti internal facet.
  5. How will the new streams be added to TransportFacetModule.
  6. As it does not allow a hook point.

Thanks
Amit

On Wednesday, July 3, 2013 11:08:33 PM UTC+5:30, Amit Singh wrote:

Hi All,

I am trying to build a new facet for my requirement but could not find a
way to plugin my facet in Elasticsearch.

I am using Elasticsearch 0.90.1 version.

What I did so far;

  1. Created a facet extending the Facet.
  2. Extended the facetbuilder with returning the new custom facet
    builder.
  3. Create the parser , executor and other dependent classes.

When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom
facet needs to added there.

I am hoping after I add the custom parser to *FacetModule, *it would get
added to list and start working.

But my requirement is to add the custom facet as separate project/jar.
This way I would not be modifying the existing code, would be able to
update Elasticsearch without any issues. I have looked through the forum
but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Here are a couple of tutorials regarding some plugin basics:
http://jprante.github.io/lessons/2012/03/27/Writing-a-simple-plugin-for-Elasticsearch.html

Here are some actual facet plugins:
https://github.com/bleskes/elasticfacets

--
Ivan

On Wed, Jul 3, 2013 at 12:04 PM, Amit Singh amitsingh.kec@gmail.com wrote:

Thanks David,

I will hook the plugin as suggested by you and let you know of any other
issues/concerns.

Thanks
Amit

On Thursday, July 4, 2013 12:25:56 AM UTC+5:30, David Pilato wrote:

I add to this that you could be interested in looking at
https://github.com/**elasticsearch/elasticsearch/**
blob/master/src/main/java/org/elasticsearch/plugins/
PluginsService.java?source=cc#**L397https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/plugins/PluginsService.java?source=cc#L397

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:42, David Pilato da...@pilato.fr a écrit :

You need to have this kind of file in your jar:
https://github.com/**elasticsearch/elasticsearch-**
river-rabbitmq/blob/master/**src/main/resources/es-plugin.**propertieshttps://github.com/elasticsearch/elasticsearch-river-rabbitmq/blob/master/src/main/resources/es-plugin.properties

Elasticsearch will load it from /plugins/yourpluginname/**yourpluginjar
when you start the node.

Does it help?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 juil. 2013 à 20:19, Amit Singh amitsi...@gmail.com a écrit :

Thanks Ivan for the reply.

I am pretty new to writing plugin for Elasticsearch.
I will try to plugin my facet as suggested by you.

I have few questions;

  1. But how will the plugin be part of Elasticsearch.
  2. Adding the custom project/jar to the lib of Elasticsearch work.
  3. Or the project/jar needs to added differently to the class-path of
    Elasticsearch.
  4. I have added a new TermsStatsStringFacetMulti internal facet.
  5. How will the new streams be added to TransportFacetModule.
  6. As it does not allow a hook point.

Thanks
Amit

On Wednesday, July 3, 2013 11:08:33 PM UTC+5:30, Amit Singh wrote:

Hi All,

I am trying to build a new facet for my requirement but could not find a
way to plugin my facet in Elasticsearch.

I am using Elasticsearch 0.90.1 version.

What I did so far;

  1. Created a facet extending the Facet.
  2. Extended the facetbuilder with returning the new custom facet
    builder.
  3. Create the parser , executor and other dependent classes.

When I try to execute my facet I get the below error.

Parse Failure [No facet type found for [multi_terms_stats]]];

After further looking at the exception.

FacetParseElement.java holds the list of facetParsers. And the custom
facet needs to added there.

I am hoping after I add the custom parser to *FacetModule, *it would
get added to list and start working.

But my requirement is to add the custom facet as separate project/jar.
This way I would not be modifying the existing code, would be able to
update Elasticsearch without any issues. I have looked through the forum
but could not find any definitive guide to custom faceting.

Any help would be greatly appreciated.

Thanks

Amit

--
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.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.