I'm trying to write a TokenFilter plugin that will wrap an existing TokenFilter (in this case, a stemmer), and I'm having trouble working out how to get access to that existing filter in the plugin's TokenFilterFactory. Does anyone have any suggestions? I've tried passing in an IndicesAnalysisService, but that doesn't seem to contain the standard stemmer filters.
TokenFilters are operating in a chain, so there is rarely a need to wrap
one filter into another because you can simply add your filter before or
after the filter that you are trying to wrap. If you really really need to
wrap it, you can simply create a new stemmer.
On Thursday, January 24, 2013 6:44:49 AM UTC-5, Alan Woodward wrote:
Hi,
I'm trying to write a TokenFilter plugin that will wrap an existing
TokenFilter (in this case, a stemmer), and I'm having trouble working out
how to get access to that existing filter in the plugin's
TokenFilterFactory. Does anyone have any suggestions? I've tried passing
in an IndicesAnalysisService, but that doesn't seem to contain the standard
stemmer filters.
can you do a simple cast in the wrapper and configure the token filter so
it gets injected as the input TokenStream?
simon
On Thursday, January 24, 2013 12:44:49 PM UTC+1, Alan Woodward wrote:
Hi,
I'm trying to write a TokenFilter plugin that will wrap an existing
TokenFilter (in this case, a stemmer), and I'm having trouble working out
how to get access to that existing filter in the plugin's
TokenFilterFactory. Does anyone have any suggestions? I've tried passing
in an IndicesAnalysisService, but that doesn't seem to contain the standard
stemmer filters.
I solved this without doing any wrapping at all in the end, by inserting a TokenFilter into the stream that added KeywordAttributes to the relevant tokens, so that the stemmer would then ignore them.
Thanks for the suggestions, though!
Alan Woodward
On 2 Feb 2013, at 20:11, simonw wrote:
Hey Alan,
can you do a simple cast in the wrapper and configure the token filter so it gets injected as the input TokenStream?
simon
On Thursday, January 24, 2013 12:44:49 PM UTC+1, Alan Woodward wrote:
Hi,
I'm trying to write a TokenFilter plugin that will wrap an existing TokenFilter (in this case, a stemmer), and I'm having trouble working out how to get access to that existing filter in the plugin's TokenFilterFactory. Does anyone have any suggestions? I've tried passing in an IndicesAnalysisService, but that doesn't seem to contain the standard stemmer filters.
On Sunday, February 3, 2013 11:18:20 AM UTC+1, Alan Woodward wrote:
I solved this without doing any wrapping at all in the end, by inserting a
TokenFilter into the stream that added KeywordAttributes to the relevant
tokens, so that the stemmer would then ignore them.
can you do a simple cast in the wrapper and configure the token filter so
it gets injected as the input TokenStream?
simon
On Thursday, January 24, 2013 12:44:49 PM UTC+1, Alan Woodward wrote:
Hi,
I'm trying to write a TokenFilter plugin that will wrap an existing
TokenFilter (in this case, a stemmer), and I'm having trouble working out
how to get access to that existing filter in the plugin's
TokenFilterFactory. Does anyone have any suggestions? I've tried passing
in an IndicesAnalysisService, but that doesn't seem to contain the standard
stemmer filters.
--
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.
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.