Register a custom Lucene filter and parser for testing


(sebastian.paetzold) #1

Hi,

I'm currently writing a Lucene filter which should filter an index so that
user's only see part of the available documents according to some external
permission source.

My question: How can I register the filter and its query parser in code in
a testing scenario. Currently I'm bootstrapping a node like that:

NodeBuilder.nodeBuilder().local(true).settings(
ImmutableSettings.settingsBuilder()
.put("gateway.type", "local")
.put("path.data", "./target/test/data")
.put("path.logs", "./target/test/logs")
.put("path.work", "./target/test/work")
.put("cluster.name", "tester")
.put("network.host", "127.0.0.1")
).node();

I have the feeling that I should the classes or instances of it somehow
following that scheme. Sadly, I don't know how. Can you point me in the
right direction?

Thanks!

-Sebastian

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


(David Pilato) #2

You could add a es-plugin.properties file in your classpath.
Just as other plugins.

Something like: https://github.com/elasticsearch/elasticsearch-analysis-phonetic/blob/master/src/main/resources/es-plugin.properties

It will be loaded by elasticsearch when the node start.

Does it help?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 2 sept. 2013 à 18:11, sebastian.paetzold@ysura.com a écrit :

Hi,

I'm currently writing a Lucene filter which should filter an index so that user's only see part of the available documents according to some external permission source.

My question: How can I register the filter and its query parser in code in a testing scenario. Currently I'm bootstrapping a node like that:

NodeBuilder.nodeBuilder().local(true).settings(
ImmutableSettings.settingsBuilder()
.put("gateway.type", "local")
.put("path.data", "./target/test/data")
.put("path.logs", "./target/test/logs")
.put("path.work", "./target/test/work")
.put("cluster.name", "tester")
.put("network.host", "127.0.0.1")
).node();

I have the feeling that I should the classes or instances of it somehow following that scheme. Sadly, I don't know how. Can you point me in the right direction?

Thanks!

-Sebastian

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


(system) #3