I have a java application which uses Elasticsearch client (transport
client). I need to analyze string taking mapping which is used by ES. I
know I can prepare analyze request to elasticsearch but it means a lot of
requests to ES. Is it possible to get somehow Lucene Analyzer from client
object and then use it to build TokenStream?
I have a java application which uses Elasticsearch client (transport
client). I need to analyze string taking mapping which is used by ES. I
know I can prepare analyze request to elasticsearch but it means a lot of
requests to ES. Is it possible to get somehow Lucene Analyzer from client
object and then use it to build TokenStream?
It is definitely possible. You can create the analysis service locally and
query it for the appropriate analyzers. I use this method the pre-analyze
terms for span queries, which does not analyze text. You would need a local
copy of your elasticsearch.yml and related files (stopwords, synonyms, etc)
or redefine everything in code.
Look at the existing test code for how to create an analysis service via
the guice injector. For example:
I have a java application which uses Elasticsearch client (transport
client). I need to analyze string taking mapping which is used by ES. I
know I can prepare analyze request to elasticsearch but it means a lot of
requests to ES. Is it possible to get somehow Lucene Analyzer from client
object and then use it to build TokenStream?
Hi,
Thank you for all of those suggestions. I think this will work for me.
--
Paweł Róg
On Mon, Oct 6, 2014 at 4:54 AM, Ivan Brusic ivan@brusic.com wrote:
It is definitely possible. You can create the analysis service locally and
query it for the appropriate analyzers. I use this method the pre-analyze
terms for span queries, which does not analyze text. You would need a local
copy of your elasticsearch.yml and related files (stopwords, synonyms, etc)
or redefine everything in code.
Look at the existing test code for how to create an analysis service via
the guice injector. For example:
I have a java application which uses Elasticsearch client (transport
client). I need to analyze string taking mapping which is used by ES. I
know I can prepare analyze request to elasticsearch but it means a lot of
requests to ES. Is it possible to get somehow Lucene Analyzer from client
object and then use it to build TokenStream?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.