# Register a custom Lucene filter and parser for testing

**URL:** https://discuss.elastic.co/t/register-a-custom-lucene-filter-and-parser-for-testing/13436
**Category:** Elasticsearch
**Created:** [September 2, 2013, 4:11pm UTC](https://discuss.elastic.co/t/register-a-custom-lucene-filter-and-parser-for-testing/13436 "2013-09-02T16:11:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sebastian\_paetzold](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastian_paetzold/32/1986_2.png) [@sebastian\_paetzold](https://discuss.elastic.co/u/sebastian_paetzold)
#### Post date: [September 2, 2013, 4:11pm UTC](https://discuss.elastic.co/t/register-a-custom-lucene-filter-and-parser-for-testing/13436/1 "2013-09-02T16:11:10Z")

</div>

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 2, 2013, 4:38pm UTC](https://discuss.elastic.co/t/register-a-custom-lucene-filter-and-parser-for-testing/13436/2 "2013-09-02T16:38:53Z")

</div>

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](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](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 2 sept. 2013 à 18:11, [sebastian.paetzold@ysura.com](mailto: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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:18am UTC](https://discuss.elastic.co/t/register-a-custom-lucene-filter-and-parser-for-testing/13436/3 "2017-07-06T02:18:27Z")

</div>


