code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Test
public void shouldPerformContainsOperation() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setMessage("contains some message");
sampleEntit... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformContainsOperation | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldExecuteExpression() {
// given
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setMessage("elasticsearch search");
sampleEn... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldExecuteExpression | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldExecuteCriteriaChain() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setMessage("some message search");
sampleEntity1.set... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldExecuteCriteriaChain | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformIsNotOperation() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setMessage("bar");
sampleEntity1.setVersion(System.... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformIsNotOperation | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformBetweenOperation() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setRate(100);
sampleEntity1.setMessage("bar");
... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformBetweenOperation | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformBetweenOperationWithoutUpperBound() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setRate(300);
sampleEntity1.setM... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformBetweenOperationWithoutUpperBound | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformBetweenOperationWithoutLowerBound() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setRate(500);
sampleEntity1.setM... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformBetweenOperationWithoutLowerBound | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformLessThanEqualOperation() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setRate(700);
sampleEntity1.setMessage("bar... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformLessThanEqualOperation | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformGreaterThanEquals() {
List<IndexQuery> indexQueries = new ArrayList<>();
// first document
String documentId = nextIdAsString();
SampleEntity sampleEntity1 = new SampleEntity();
sampleEntity1.setId(documentId);
sampleEntity1.setRate(900);
sampleEntity1.setMessage("bar");
... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformGreaterThanEquals | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldPerformBoostOperation() {
String documentId = nextIdAsString();
SampleEntity sampleEntity = new SampleEntity();
sampleEntity.setId(documentId);
sampleEntity.setRate(700);
sampleEntity.setMessage("foo");
sampleEntity.setVersion(System.currentTimeMillis());
operations.save(sampleE... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldPerformBoostOperation | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
public void shouldReturnDocumentAboveMinimalScoreGivenCriteria() {
List<IndexQuery> indexQueries = new ArrayList<>();
indexQueries.add(buildIndex(new SampleEntity("1", "ab")));
indexQueries.add(buildIndex(new SampleEntity("2", "bc")));
indexQueries.add(buildIndex(new SampleEntity("3", "ac")));
operati... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldReturnDocumentAboveMinimalScoreGivenCriteria | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test // DATAES-213
public void shouldEscapeValue() {
String documentId = nextIdAsString();
SampleEntity sampleEntity = new SampleEntity();
sampleEntity.setId(documentId);
sampleEntity.setMessage("Hello World!");
sampleEntity.setVersion(System.currentTimeMillis());
IndexQuery indexQuery = new IndexQuery(... | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | shouldEscapeValue | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | getId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public void setId(@Nullable String id) {
this.id = id;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | setId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public String getType() {
return type;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | getType | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public void setType(@Nullable String type) {
this.type = type;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | setType | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public String getMessage() {
return message;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | getMessage | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public void setMessage(@Nullable String message) {
this.message = message;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | setMessage | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public int getRate() {
return rate;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | getRate | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public void setRate(int rate) {
this.rate = rate;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | setRate | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public java.lang.@Nullable Long getVersion() {
return version;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | getVersion | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
public void setVersion(java.lang.@Nullable Long version) {
this.version = version;
} | @author Rizwan Idrees
@author Mohsin Husen
@author Peter-Josef Meisch
@author James Bodkin | setVersion | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByName() throws NoSuchMethodException, JSONException {
String methodName = "findByName";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] parameters = new Object[] { BOOK_TITLE };
String query = getQueryString(methodName, parameterClasses, parameters);
String expected = "... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameNot() throws NoSuchMethodException, JSONException {
String methodName = "findByNameNot";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] parameters = new Object[] { BOOK_TITLE };
String query = getQueryString(methodName, parameterClasses, parameters);
String expect... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameNot | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameLike() throws NoSuchMethodException, JSONException {
String methodName = "findByNameLike";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] parameters = new Object[] { BOOK_TITLE };
String query = getQueryString(methodName, parameterClasses, parameters);
String expe... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameLike | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameStartingWith() throws NoSuchMethodException, JSONException {
String methodName = "findByNameStartingWith";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] parameters = new Object[] { BOOK_TITLE };
String query = getQueryString(methodName, parameterClasses, parameters)... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameStartingWith | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameEndingWith() throws NoSuchMethodException, JSONException {
String methodName = "findByNameEndingWith";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] parameters = new Object[] { BOOK_TITLE };
String query = getQueryString(methodName, parameterClasses, parameters);
... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameEndingWith | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameContaining() throws NoSuchMethodException, JSONException {
String methodName = "findByNameContaining";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] parameters = new Object[] { BOOK_TITLE };
String query = getQueryString(methodName, parameterClasses, parameters);
... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameContaining | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameIn() throws NoSuchMethodException, JSONException {
String methodName = "findByNameIn";
Class<?>[] parameterClasses = new Class[] { Collection.class };
List<String> names = new ArrayList<>();
names.add(BOOK_TITLE);
names.add(BOOK_TITLE + "2");
Object[] parameters = new Object[] { names ... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameIn | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameNotIn() throws NoSuchMethodException, JSONException {
String methodName = "findByNameNotIn";
Class<?>[] parameterClasses = new Class[] { Collection.class };
List<String> names = new ArrayList<>();
names.add(BOOK_TITLE);
names.add(BOOK_TITLE + "2");
Object[] parameters = new Object[] { ... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameNotIn | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPrice() throws NoSuchMethodException, JSONException {
String methodName = "findByPrice";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { 42 };
String query = getQueryString(methodName, parameterClasses, parameters);
String expected = "{\"qu... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameAndPrice() throws NoSuchMethodException, JSONException {
String methodName = "findByNameAndPrice";
Class<?>[] parameterClasses = new Class[] { String.class, Integer.class };
Object[] parameters = new Object[] { BOOK_TITLE, BOOK_PRICE };
String query = getQueryString(methodName, parameterC... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameAndPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByNameOrPrice() throws NoSuchMethodException, JSONException {
String methodName = "findByNameOrPrice";
Class<?>[] parameterClasses = new Class[] { String.class, Integer.class };
Object[] parameters = new Object[] { BOOK_TITLE, BOOK_PRICE };
String query = getQueryString(methodName, parameterCla... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByNameOrPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceBetween() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceBetween";
Class<?>[] parameterClasses = new Class[] { Integer.class, Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE - 10, BOOK_PRICE + 10 };
String query = getQueryString(methodName,... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceBetween | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceLessThan() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceLessThan";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE };
String query = getQueryString(methodName, parameterClasses, parameters);
... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceLessThan | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceLessThanEqual() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceLessThanEqual";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE };
String query = getQueryString(methodName, parameterClasses, parame... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceLessThanEqual | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceGreaterThan() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceGreaterThan";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE };
String query = getQueryString(methodName, parameterClasses, parameters... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceGreaterThan | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceGreaterThanEqual() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceGreaterThanEqual";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE };
String query = getQueryString(methodName, parameterClasses, ... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceGreaterThanEqual | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceBefore() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceBefore";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE };
String query = getQueryString(methodName, parameterClasses, parameters);
Stri... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceBefore | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByPriceAfter() throws NoSuchMethodException, JSONException {
String methodName = "findByPriceAfter";
Class<?>[] parameterClasses = new Class[] { Integer.class };
Object[] parameters = new Object[] { BOOK_PRICE };
String query = getQueryString(methodName, parameterClasses, parameters);
String... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByPriceAfter | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByAvailableTrue() throws NoSuchMethodException, JSONException {
String methodName = "findByAvailableTrue";
Class<?>[] parameterClasses = new Class[] {};
Object[] parameters = new Object[] {};
String query = getQueryString(methodName, parameterClasses, parameters);
String expected = "{\"query... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByAvailableTrue | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByAvailableFalse() throws NoSuchMethodException, JSONException {
String methodName = "findByAvailableFalse";
Class<?>[] parameterClasses = new Class[] {};
Object[] parameters = new Object[] {};
String query = getQueryString(methodName, parameterClasses, parameters);
String expected = "{\"que... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByAvailableFalse | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test
void findByAvailableTrueOrderByNameDesc() throws NoSuchMethodException, JSONException {
String methodName = "findByAvailableTrueOrderByNameDesc";
Class<?>[] parameterClasses = new Class[] {};
Object[] parameters = new Object[] {};
String query = getQueryString(methodName, parameterClasses, parameters);
... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | findByAvailableTrueOrderByNameDesc | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test // #3072
@DisplayName("should build sort object with correct field names")
void shouldBuildSortObjectWithCorrectFieldNames() throws NoSuchMethodException, JSONException {
String methodName = "findByNameOrderBySortAuthor_SortName";
Class<?>[] parameterClasses = new Class[] { String.class };
Object[] param... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | shouldBuildSortObjectWithCorrectFieldNames | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Test // #3081
@DisplayName("should build sort object with unknown field names")
void shouldBuildSortObjectWithUnknownFieldNames() throws NoSuchMethodException, JSONException {
String methodName = "findByName";
Class<?>[] parameterClasses = new Class[] { String.class, Sort.class };
Object[] parameters = new Ob... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | shouldBuildSortObjectWithUnknownFieldNames | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
private String getQueryString(String methodName, Class<?>[] parameterClasses, Object[] parameters)
throws NoSuchMethodException {
Method method = SampleRepository.class.getMethod(methodName, parameterClasses);
ElasticsearchQueryMethod queryMethod = new ElasticsearchQueryMethod(method,
new DefaultRepositoryM... | Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming.
Classes implementing this abstract class are in the packages of their request factories and converters as these are
kept package private.
@author Peter-Josef Meisch
@author Haibo Liu | getQueryString | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
private void assertAny(AssertFunction... funcs) {
int failed = 0;
for (AssertFunction func : funcs) {
try {
func.get();
} catch (AssertionError | JSONException ignored) {
failed++;
}
}
if (failed == funcs.length) {
throw new AssertionError("none of the assertions held");
}
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | assertAny | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | getId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public void setId(String id) {
this.id = id;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | setId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public String getName() {
return name;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | getName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public void setName(String name) {
this.name = name;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | setName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public Integer getPrice() {
return price;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | getPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public void setPrice(Integer price) {
this.price = price;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | setPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public Boolean getAvailable() {
return available;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | getAvailable | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public Author getSortAuthor() {
return sortAuthor;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | getSortAuthor | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public void setSortAuthor(@Nullable Author sortAuthor) {
this.sortAuthor = sortAuthor;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | setSortAuthor | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public void setAvailable(Boolean available) {
this.available = available;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | setAvailable | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@Nullable
public String getSortName() {
return sortName;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | getSortName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
public void setSortName(@Nullable String sortName) {
this.sortName = sortName;
} | builds the query String that would be sent to Elasticsearch
@param query the {@link Query}
@param clazz the entity class
@return the created query string | setSortName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java | Apache-2.0 |
@BeforeEach
void setUp() {
indexNameProvider.increment();
operations.indexOps(SomethingToBuy.class).createWithMapping();
operations.indexOps(Person.class).createWithMapping();
operations.indexOps(SAREntity.class).createWithMapping();
} | @author Peter-Josef Meisch
@author cdalxndr | setUp | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test
@Order(java.lang.Integer.MAX_VALUE)
void cleanup() {
operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + '*')).delete();
} | @author Peter-Josef Meisch
@author cdalxndr | cleanup | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #1971
@DisplayName("should use runtime-field from query in search")
void shouldUseRuntimeFieldFromQueryInSearch() {
insert("1", "item 1", 13.5);
insert("2", "item 2", 15);
Query query = new CriteriaQuery(new Criteria("priceWithTax").greaterThanEqual(16.5));
RuntimeField runtimeField = new RuntimeFie... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRuntimeFieldFromQueryInSearch | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2267
@DisplayName("should use runtime-field without script")
void shouldUseRuntimeFieldWithoutScript() {
// a runtime field without a script can be used to redefine the type of a field for the search,
// here we change the type from text to double
insert("1", "11", 10);
Query query = new CriteriaQu... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRuntimeFieldWithoutScript | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2431
@DisplayName("should return value from runtime field defined in mapping")
void shouldReturnValueFromRuntimeFieldDefinedInMapping() {
var person = new Person();
var years = 10;
var birthDate = LocalDate.now().minusDays(years * 365 + 100);
person.setBirthDate(birthDate);
operations.save(person... | @author Peter-Josef Meisch
@author cdalxndr | shouldReturnValueFromRuntimeFieldDefinedInMapping | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #3076
@DisplayName("should return scripted fields that are lists")
void shouldReturnScriptedFieldsThatAreLists() {
var person = new Person();
person.setFirstName("John");
person.setLastName("Doe");
operations.save(person);
var query = Query.findAll();
query.addFields("allNames");
query.addSourc... | @author Peter-Josef Meisch
@author cdalxndr | shouldReturnScriptedFieldsThatAreLists | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2035
@DisplayName("should use repository method with ScriptedField parameters")
void shouldUseRepositoryMethodWithScriptedFieldParameters() {
var entity = new SAREntity();
entity.setId("42");
entity.setValue(3);
repository.save(entity);
org.springframework.data.elasticsearch.core.query.Scripted... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRepositoryMethodWithScriptedFieldParameters | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2035
@DisplayName("should use repository string query method with ScriptedField parameters")
void shouldUseRepositoryStringQueryMethodWithScriptedFieldParameters() {
var entity = new SAREntity();
entity.setId("42");
entity.setValue(3);
repository.save(entity);
org.springframework.data.elasticse... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRepositoryStringQueryMethodWithScriptedFieldParameters | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2035
@DisplayName("should use repository method with RuntimeField parameters")
void shouldUseRepositoryMethodWithRuntimeFieldParameters() {
var entity = new SAREntity();
entity.setId("42");
entity.setValue(3);
repository.save(entity);
var runtimeField1 = buildRuntimeField("scriptedValue1", 3);
... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRepositoryMethodWithRuntimeFieldParameters | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2035
@DisplayName("should use repository string query method with RuntimeField parameters")
void shouldUseRepositoryStringQueryMethodWithRuntimeFieldParameters() {
var entity = new SAREntity();
entity.setId("42");
entity.setValue(3);
repository.save(entity);
var runtimeField1 = buildRuntimeFiel... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRepositoryStringQueryMethodWithRuntimeFieldParameters | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
private void insert(String id, String description, double price) {
SomethingToBuy entity = new SomethingToBuy();
entity.setId(id);
entity.setDescription(description);
entity.setPrice(price);
operations.save(entity);
} | @author Peter-Josef Meisch
@author cdalxndr | insert | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #2303
@DisplayName("should use parameters for runtime fields in search queries")
void shouldUseParametersForRuntimeFieldsInSearchQueries() {
insert("1", "item 1", 80.0);
insert("2", "item 2", 90.0);
RuntimeField runtimeField = new RuntimeField(
"priceWithTax",
"double",
"emit(doc['price']... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseParametersForRuntimeFieldsInSearchQueries | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Test // #3076
@DisplayName("should use runtime fields in queries returning lists")
void shouldUseRuntimeFieldsInQueriesReturningLists() {
insert("1", "item 1", 80.0);
var runtimeField = new RuntimeField(
"someStrings",
"keyword",
"emit('foo'); emit('bar');",
null);
var query = Query.findAll(... | @author Peter-Josef Meisch
@author cdalxndr | shouldUseRuntimeFieldsInQueriesReturningLists | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@NotNull
private static org.springframework.data.elasticsearch.core.query.ScriptedField buildScriptedField(String fieldName,
int factor) {
return org.springframework.data.elasticsearch.core.query.ScriptedField.of(
fieldName,
ScriptData.of(b -> b
.withScript("doc['value'].size() > 0 ? doc['value'].va... | build a {@link org.springframework.data.elasticsearch.core.query.ScriptedField} to return the product of the
document's value property and the given factor | buildScriptedField | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@NotNull
private static RuntimeField buildRuntimeField(String fieldName, int factor) {
return new RuntimeField(
fieldName,
"long",
String.format("emit(doc['value'].size() > 0 ? doc['value'].value * %d : 0)", factor));
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | buildRuntimeField | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setId(@Nullable String id) {
this.id = id;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public String getDescription() {
return description;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getDescription | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setDescription(@Nullable String description) {
this.description = description;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setDescription | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public Double getPrice() {
return price;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setPrice(@Nullable Double price) {
this.price = price;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setPrice | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public List<String> getSomeStrings() {
return someStrings;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getSomeStrings | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setSomeStrings(@Nullable List<String> someStrings) {
this.someStrings = someStrings;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setSomeStrings | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setId(@Nullable String id) {
this.id = id;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public String getFirstName() {
return firstName;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getFirstName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setFirstName(@Nullable String firstName) {
this.firstName = firstName;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setFirstName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public String getLastName() {
return lastName;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getLastName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setLastName(@Nullable String lastName) {
this.lastName = lastName;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setLastName | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public LocalDate getBirthDate() {
return birthDate;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getBirthDate | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setBirthDate(@Nullable LocalDate birthDate) {
this.birthDate = birthDate;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setBirthDate | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public Integer getAge() {
return age;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getAge | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setAge(@Nullable Integer age) {
this.age = age;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setAge | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public List<String> getAllNames() {
return allNames;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getAllNames | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setAllNames(List<String> allNames) {
this.allNames = allNames;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setAllNames | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setId(@Nullable String id) {
this.id = id;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setId | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public Integer getValue() {
return value;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getValue | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setValue(@Nullable Integer value) {
this.value = value;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setValue | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
@Nullable
public Integer getScriptedValue1() {
return scriptedValue1;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | getScriptedValue1 | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
public void setScriptedValue1(@Nullable Integer scriptedValue1) {
this.scriptedValue1 = scriptedValue1;
} | build a {@link RuntimeField} to return the product of the document's value property and the given factor | setScriptedValue1 | java | spring-projects/spring-data-elasticsearch | src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.