I have a question regarding SpanNearQueries. As I saw Term Queries
were not analyzed before search, but are SpanNearQueries? Is there a
way to analyze the SpanTermQueries inside of SpanNearQueries using the
analyzer defined in the field mapping.
I have a question regarding SpanNearQueries. As I saw Term Queries
were not analyzed before search, but are SpanNearQueries? Is there a
way to analyze the SpanTermQueries inside of SpanNearQueries using the
analyzer defined in the field mapping.
okay, is there a way to workaround? We would like to have analyzed terms
within the SpanQuery, or is the only way to analyze by hand and put the
terms then back into the SpanQuery?
I have a question regarding SpanNearQueries. As I saw Term Queries
were not analyzed before search, but are SpanNearQueries? Is there a
way to analyze the SpanTermQueries inside of SpanNearQueries using the
analyzer defined in the field mapping.
okay, is there a way to workaround? We would like to have analyzed
terms within the SpanQuery, or is the only way to analyze by hand and
put the terms then back into the SpanQuery?
Yes, I'm afraid that's the only way.
One way that you could approach it is to use the 'analyze' API. So you
pass your text to ES, get the analyzed results back, then use those.
Not sure it is the most efficient way of doing it though.
okay, is there a way to workaround? We would like to have analyzed
terms within the SpanQuery, or is the only way to analyze by hand and
put the terms then back into the SpanQuery?
Yes, I'm afraid that's the only way.
One way that you could approach it is to use the 'analyze' API. So you
pass your text to ES, get the analyzed results back, then use those.
Not sure it is the most efficient way of doing it though.
I just found this forum thread which is related to my problem.
Is there anything new in Elasticsearch to avoid the workaround proposed by Clinton (as far as I know, it is not the case)?
Maybe an enhancement to the workaround is to create a plugin on the ES side that does the analysis in order to avoid a query to the analysis API from the client side. Is it a correct approach?
If you using Java, I used to use the analysis service locally using the
TransportClient. Not sure that is even possible, since so many useful
workarounds have been closed. The issue does not stem from Elasticsearch,
but Lucene, since that is where the limitation is.
It should be clear that when I said the issue is in Lucene, I mean the need
to pre-analyze tokens.
It used to be easy to create your own AnalysisService locally (if using the
Java client), but I might have gotten difficult with each new version of
Elasticsearch. I have not SpanQueries since 1.x. Just look at any unit
tests for the analysis chain such as CharFilterTests:
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.