-
Notifications
You must be signed in to change notification settings - Fork 243
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
HSEARCH-2434 Add support for Elasticsearch 5 #1329
Conversation
3f5dfe0
to
52d2162
Compare
Note: I just pushed an update which added the commit "When validating Elasticsearch schemas, use "default" as a default value for analyzer references" and the next one. |
4691fe7
to
3d43ebd
Compare
Jenkins, retest this please |
1 similar comment
Jenkins, retest this please |
@Sanne This should be ready for review. About the builds: the previous CI build passed, but the one before failed for no apparent reason, so I'm launching another one to see if it was a transient failure that can be blamed on the slave (concurrent build or whatever) or if there is a randomly occurring problem in Hibernate Search itself. |
…tead of doing so in elasticsearch.yml This is required for ES5, where analyzers cannot be configured in elasticsearch.yml.
…replica by default in ITs
…ng to the ES schema There is no reason to do that, and it forces us to implement yet another special case for ES5.
…ting in a particular order The index managers are stored in a hashmap, whose order is undefined. Strangely, our tests seem to have been working until now.
…iptFields The hack is unnecessary because we use explicit source filtering (we have been for a while), so source is always included in the query hits. Incidentally, this hack is a problem in ES5 since we should use "stored_fields" instead of "fields".
GeoPoints functions have changed: arcDistanceInKm has been removed, we must use arcDistance which returns meters.
… them work on ES5
…pect to cluster status "yellow" is now the color of a fully-started cluster with no replica, so we'd better use that in test (where we don't have replicas).
…sticsearch 5 This is necessary because the "refresh" parameter in the Flush API has been removed in ES5. See elasticsearch/elasticsearch:7cc48c8e8723d3b31fbcb371070bc2a8d87b1f7e
If we reach the "if ( isNumeric(...)) " in "getType", it means we don't have any bridge-defined field for this field name (see the code at the top of "getType"). Thus "FieldHelper.getNumericEncoding(...)" is useless, we can simply use "DocumentFieldMetadata.getNumericEncoding()". Also, "DocumentFieldMetadata.isNumeric" already is true if the field bridge is a NumericFieldBridge or wraps one. Thus "FieldHelper.isNumeric(...)" is useless, we can simply use "DocumentFieldMetadata.isNumeric()".
… in Elasticsearch 5
The bounding box query doesn't include geo points located on the left and bottom sides of the box as of ES 5.
…ment array containing null with ES5 This happens at least on ES 5.0.
Our CI seems to be too slow: 30s isn't enough.
Jenkins, retest this please |
Jenkins, retest this please |
1 similar comment
Jenkins, retest this please |
There are some problems with the Maven profiles: The plugin versions and tasks need to have stricter separation among profiles? |
@Sanne So... This situation is not new, it's been here since I introduced the elasticsearch profiles. The elasticsearch-5.0 profile is enabled automatically when the Unfortunately, "a property is not defined" for Maven means "not defined explicitly", and definitions in explicitly enabled profiles do not count. So in your case, you had both the So, if you want to run 2.0/2.2 tests, you must either:
I'll see if I can change the poms to make things easier, but I doubt it... |
ah right! Sorry I forgot about that. No rush with improvements, I'd like to integrate this first and the README instructions are good enough for now. |
awesome work! I added one commit to address a couple of super trivial javadoc copy/paste errors. |
This PR is based on #1343 , which will have to be merged first.=> DoneRelevant JIRA ticket: https://hibernate.atlassian.net/browse/HSEARCH-2434
Compared to #1328, this PR adds the specific code needed to support ES5. To sum up #1328 introduced abstraction layers and interfaces, and this PR introduces alternative implementations of these interfaces.
Don't get fooled by the very high number of additions: I had to copy/paste 4 or 5 large test cases in order to adapt them to ES5. I tried to make them compatible with both ES2 and ES5 first, but the tests ended up almost as complex as the code being tested, so I figured it wasn't a good idea.