New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryBuilders and FilterBuilders have dependency on spatial4j which is optional. #2519
Comments
Do you get a failure in this case? I tested it, and it works fine even if you don't have the spatial4j lib in the classpath, assuming you don't call the builders that require it. |
I have found that it is not an issue for Java. It is reproduced in the Scala compiler (ver. 2.9.2). I tested two simple classes for Java and Scala. They did the same work. And the scala code got a failure. import org.elasticsearch.index.query.FilterBuilders._
class ElasticTest {
def test {
orFilter(termFilter("key", "phrase"))
}
}
About the issue: |
This issue is also present in the Groovy runtime: // this throws a NoClassDefFoundError:
def query = QueryBuilders.boolQuery() java.lang.NoClassDefFoundError: com/spatial4j/core/shape/Shape |
@danklynn which groovy version? |
@kimchy The issue is pretty issue to reproduce in Grails 2.2.1
class ClassNotFoundTests {
Running 1 unit test... 1 of 1 |
Also, FYI the issue is not present using 0.90.0.Beta1:
|
This still seem to happen in Groovy (v 2.4.15) with elasticsearch-6.6.0. Here's a (probably obvious) workaround: Wrap the method calls in Java:
|
IMHO, these classes shouldn't have hard dependencies on spatial4j library which is optional.
There is two way to resolve this issue:
The latest solution allows to keep the library optional. And it allows to use it when it is really necessary.
As one more solution, it is move geo-shape functionality to the separate library like a plugin.
The text was updated successfully, but these errors were encountered: