# Can I use my existing Lucene MultiTermQuery/FilteredTermsEnum in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/can-i-use-my-existing-lucene-multitermquery-filteredtermsenum-in-elasticsearch/57146>\
**Category:** Elasticsearch\
**Created:** [August 3, 2016, 8:05pm UTC](https://discuss.elastic.co/t/can-i-use-my-existing-lucene-multitermquery-filteredtermsenum-in-elasticsearch/57146 "2016-08-03T20:05:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joebjoeb](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@joebjoeb](https://discuss.elastic.co/u/joebjoeb)\
**Post date:** [August 3, 2016, 8:05pm UTC](https://discuss.elastic.co/t/can-i-use-my-existing-lucene-multitermquery-filteredtermsenum-in-elasticsearch/57146/1 "2016-08-03T20:05:36Z")

</div>

I have custom IP Address and Port range classes that I use in my current java application - which uses Lucene directly. Is there a straightforward way to use these in Elasticsearch? Or a better way?  
They extend MultiTermQuery and FilteredTermsEnum in  
package org.apache.lucene.search and so are available to be used in Lucene's IndexSearcher.search calls.  
I believe I'd need to have them load with the Elasticsearch Lucene Instance(s) and then be defined in a custom type that I could map to in elastic.  
Thank you.

---

<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 5, 2017, 10:30pm UTC](https://discuss.elastic.co/t/can-i-use-my-existing-lucene-multitermquery-filteredtermsenum-in-elasticsearch/57146/2 "2017-07-05T22:30:19Z")

</div>

Closed on July 5, 2017, 10:30pm UTC


