-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3961 from p-kimberley/elastic-java-api-client
Migrate to Elasticsearch Java API Client
- Loading branch information
Showing
28 changed files
with
900 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
stroom-core-shared/src/main/java/stroom/search/elastic/shared/UnsupportedTypeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package stroom.search.elastic.shared; | ||
|
||
public class UnsupportedTypeException extends Exception { | ||
|
||
public UnsupportedTypeException(final String message) { | ||
super(message); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
stroom-core-shared/src/test/java/TestElasticIndexFieldType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import stroom.datasource.api.v2.FieldType; | ||
import stroom.search.elastic.shared.ElasticNativeTypes; | ||
import stroom.search.elastic.shared.UnsupportedTypeException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertSame; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class TestElasticIndexFieldType { | ||
|
||
@Test | ||
public void testFromNativeType() throws UnsupportedTypeException { | ||
assertSame(FieldType.BOOLEAN, | ||
ElasticNativeTypes.fromNativeType("name", "boolean")); | ||
assertSame(FieldType.INTEGER, | ||
ElasticNativeTypes.fromNativeType("name", "integer")); | ||
assertSame(FieldType.LONG, | ||
ElasticNativeTypes.fromNativeType("name", "long")); | ||
assertSame(FieldType.FLOAT, | ||
ElasticNativeTypes.fromNativeType("name", "float")); | ||
assertSame(FieldType.DOUBLE, | ||
ElasticNativeTypes.fromNativeType("name", "double")); | ||
assertSame(FieldType.DATE, | ||
ElasticNativeTypes.fromNativeType("name", "date")); | ||
assertSame(FieldType.TEXT, | ||
ElasticNativeTypes.fromNativeType("name", "text")); | ||
} | ||
|
||
@Test | ||
public void testIsNumeric() throws UnsupportedTypeException { | ||
assertTrue(FieldType.INTEGER.isNumeric()); | ||
assertTrue(FieldType.LONG.isNumeric()); | ||
assertFalse(FieldType.FLOAT.isNumeric()); | ||
assertFalse(FieldType.DOUBLE.isNumeric()); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.