916 Commits

Author SHA1 Message Date
Oliver Drotbohm
e4825d52a7 DATAES-554 - Updated changelog. 2019-04-01 18:52:21 +02:00
Oliver Drotbohm
27b33e019e DATAES-527 - Updated changelog. 2019-04-01 18:49:24 +02:00
Spring Operator
9818ed0af9 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 317 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #266
2019-03-22 08:20:19 +01:00
Spring Operator
cacab0a478 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://www.elasticsearch.org/ (301) with 1 occurrences migrated to:
  https://www.elastic.co/ ([https](https://www.elasticsearch.org/) result SSLHandshakeException).
* [ ] http://www.elasticsearch.org/download/ (301) with 1 occurrences migrated to:
  https://www.elastic.co/downloads/elasticsearch ([https](https://www.elasticsearch.org/download/) result SSLHandshakeException).
* [ ] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html (301) with 2 occurrences migrated to:
  https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html ([https](https://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html) result SSLHandshakeException).
* [ ] http://www.elasticsearch.org/guide/reference/mapping/date-format/ (301) with 1 occurrences migrated to:
  https://www.elastic.co/guide/reference/mapping/date-format/ ([https](https://www.elasticsearch.org/guide/reference/mapping/date-format/) result SSLHandshakeException).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://asciidoctor.org with 1 occurrences migrated to:
  https://asciidoctor.org ([https](https://asciidoctor.org) result 200).
* [ ] http://stackoverflow.com/questions/tagged/spring-data-elasticsearch with 1 occurrences migrated to:
  https://stackoverflow.com/questions/tagged/spring-data-elasticsearch ([https](https://stackoverflow.com/questions/tagged/spring-data-elasticsearch) result 200).
* [ ] http://www.springframework.org/schema/beans/spring-beans.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* [ ] http://www.springframework.org/schema/data/repository/spring-repository.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/repository/spring-repository.xsd ([https](https://www.springframework.org/schema/data/repository/spring-repository.xsd) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://docs.spring.io/spring-data/elasticsearch/docs/current/api/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-data/elasticsearch/docs/current/api/ ([https](https://docs.spring.io/spring-data/elasticsearch/docs/current/api/) result 301).
* [ ] http://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/ ([https](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/) result 301).
* [ ] http://help.github.com/forking/ with 1 occurrences migrated to:
  https://help.github.com/forking/ ([https](https://help.github.com/forking/) result 301).
* [ ] http://projects.spring.io/spring-data with 1 occurrences migrated to:
  https://projects.spring.io/spring-data ([https](https://projects.spring.io/spring-data) result 301).
* [ ] http://www.springframework.org/schema/beans/spring-beans-3.1.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.1.xsd) result 301).
* [ ] http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd ([https](https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd) result 301).
* [ ] http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd ([https](https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd) result 301).
* [ ] http://repo.spring.io/libs-snapshot with 1 occurrences migrated to:
  https://repo.spring.io/libs-snapshot ([https](https://repo.spring.io/libs-snapshot) result 302).
* [ ] http://www.springsource.org/download with 1 occurrences migrated to:
  https://www.springsource.org/download ([https](https://www.springsource.org/download) result 302).
* [ ] http://www.springsource.org/node/feed with 1 occurrences migrated to:
  https://www.springsource.org/node/feed ([https](https://www.springsource.org/node/feed) result 302).

# Ignored
These URLs were intentionally ignored.

* http://127.0.0.1:9200 with 1 occurrences
* http://localhost:9200 with 3 occurrences
* http://www.springframework.org/schema/beans with 14 occurrences
* http://www.springframework.org/schema/data/elasticsearch with 14 occurrences
* http://www.springframework.org/schema/data/repository with 4 occurrences
* http://www.springframework.org/schema/tool with 4 occurrences
* http://www.w3.org/2001/XMLSchema with 2 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 5 occurrences

Original Pull Request: #259
2019-03-21 08:00:05 +01:00
Spring Operator
75b039a477 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://maven.apache.org/xsd/maven-4.0.0.xsd with 1 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans-3.1.xsd with 19 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.1.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd with 20 occurrences migrated to:
  https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd ([https](https://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd) result 200).
* http://java.sun.com/xml/ns/javaee/beans_1_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/javaee/beans_1_0.xsd ([https](https://java.sun.com/xml/ns/javaee/beans_1_0.xsd) result 302).

# Ignored
These URLs were intentionally ignored.

* http://java.sun.com/xml/ns/javaee with 2 occurrences
* http://maven.apache.org/POM/4.0.0 with 2 occurrences
* http://www.springframework.org/schema/beans with 44 occurrences
* http://www.springframework.org/schema/data/elasticsearch with 40 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 24 occurrences

Original Pull Request: #258
2019-03-20 12:38:23 +01:00
Spring Operator
3b834b6c60 DATAES-549 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were fixed successfully.

* http://www.apache.org/licenses/LICENSE-2.0 migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* http://www.pivotal.io migrated to:
  https://www.pivotal.io ([https](https://www.pivotal.io) result 301).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0
* http://maven.apache.org/xsd/maven-4.0.0.xsd
* http://www.w3.org/2001/XMLSchema-instance

Original pull request: #244
2019-03-19 13:04:32 -05:00
Oliver Drotbohm
13d369de20
DATAES-545 - Move off deprecations in Spring Data Commons.
Related ticket: DATACMNS-1496.
2019-03-13 19:20:40 +01:00
Petr Kukrál
11ba4c55ad DATAES-535 - Add mapping annotation @DynamicTemplates.
Original pull request: #238
2019-03-13 14:16:12 +01:00
xhaggi
efb5d9e021 DATAES-536 - Polishing
* remove unused field xContentBuilder
* add missing generics
* add XContentType to rawValue
* organize imports
2019-03-13 13:46:13 +01:00
Robert Gründler
092690d1b9 DATAES-536 - Add support for context suggester
Original pull request: #241
2019-03-13 10:27:11 +01:00
Christoph Strobl
16f2139742 DATAES-517 - After release cleanups. 2019-03-07 10:07:30 +01:00
Christoph Strobl
437f2e9cde DATAES-517 - Prepare next development iteration. 2019-03-07 10:07:29 +01:00
Christoph Strobl
0060f3d6f3 DATAES-517 - Release version 3.2 M2 (Moore). 3.2.0.M2 2019-03-07 09:42:22 +01:00
Christoph Strobl
76df6c10fc DATAES-517 - Prepare 3.2 M2 (Moore). 2019-03-07 09:41:17 +01:00
Christoph Strobl
b2e2160b45 DATAES-517 - Updated changelog. 2019-03-07 09:41:16 +01:00
Mark Paluch
c3e7056d7b DATAES-530 - Polishing.
Fix generics in ElasticsearchEntityMapper. Extract methods. Move enum conversion handling to simple type handling for symmetric implementation. Swap comparison of nullable types to avoid potential null dereference.

Rename ElasticsearchDefaultTypeMapper to DefaultElasticsearchTypeMapper. Move MapTypeAliasAccessor to DefaultElasticsearchTypeMapper.

Introduce SearchResultMapperAdapter to avoid empty method implementations in anonymous classes. Javadoc, reference docs, formatting.

Original Pull Request: #237
2019-03-06 10:03:02 +01:00
Christoph Strobl
a64af54e26 DATAES-530 - Add converter based EntityMapper.
ElasticsearchEntityMapper provides an alternative to the Jackson based EntityMapper implementation.

Original Pull Request: #237
2019-03-06 10:02:13 +01:00
Mark Paluch
1dc113d57b DATAES-537 - Upgrade to Elasticsearch 6.6.1.
Adapt tests to use new IndicesOptions defaults.

Original Pull Request: #243
2019-03-06 09:29:37 +01:00
Greg Turnquist
e81e38dbb1
DATAES-526 - Introduce Concourse. 2019-02-28 10:41:05 -06:00
Peter Nowak
e0831fa234 DATAES-525 - Fixed issue in scrolling not applying the search query.
The root cause of the deletion problem was the doScroll which did not apply the given query and therefor returned all entries from the index.
The doScroll implementation has been fixed to apply the query and multiple unit tests have been added to ensure that the delete methods delete the desired documents only and leave the rest untouched.
Also added unit tests for the scrolling to test it against real queries (not only matchAll).

Original pull request: #240
2019-02-21 08:27:30 +01:00
Ivan Greene
c77b543fb8 DATAES-523 - Allow specifying version type.
Allow specifying the version type for documents.

Original pull request: #236
2019-02-21 08:24:29 +01:00
Mark Paluch
ae1accd13b DATAES-529 - Updated changelog. 2019-02-13 11:47:59 +01:00
lw
4bef221217 DATAES-500 - queryForList(CriteriaQuery query, Class<T> clazz) can't query all data.
Original pull request: #225
2019-01-24 17:56:19 +01:00
Peter Nowak
a89a44b08f DATAES-531 - Fixed getMapping from ElasticsearchRestTemplate.
The getMapping methods in the ElasticsearchRestTemplate now behave like the methods in the ElasticsearchTemplate and return the mapping for the specified index and type.

Original pull request: #239
2019-01-24 17:24:38 +01:00
Christoph Strobl
69dc36c6c3 DATAES-519 - Add reactive repository support.
Reactive Elasticsearch repository support builds on the core repository support utilizing
operations provided via ReactiveElasticsearchOperations executed by a ReactiveElasticsearchClient.

Spring Data Elasticsearchs reactive repository support uses Project Reactor as its reactive
composition library of choice.

There are 3 main interfaces to be used:

* ReactiveRepository
* ReactiveCrudRepository
* ReactiveSortingRepository

For Java configuration, use the @EnableReactiveElasticsearchRepositories annotation.
The following listing shows how to use Java configuration for a repository:

@Configuration
@EnableReactiveElasticsearchRepositories
public class Config extends AbstractReactiveElasticsearchConfiguration {

  @Override
  public ReactiveElasticsearchClient reactiveElasticsearchClient() {
    return ReactiveRestClients.create(ClientConfiguration.localhost());
  }
}

Using a repository that extends ReactiveSortingRepository makes all CRUD operations available
as well as methods for sorted access to the entities. Working with the repository instance is a matter of dependency
injecting it into a client.

The repository itself allows defining additional methods backed by the inferred proxy.

public interface ReactivePersonRepository extends ReactiveSortingRepository<Person, String> {

  Flux<Person> findByFirstname(String firstname);

  Flux<Person> findByFirstname(Publisher<String> firstname);

  Flux<Person> findByFirstnameOrderByLastname(String firstname);

  Flux<Person> findByFirstname(String firstname, Sort sort);

  Flux<Person> findByFirstname(String firstname, Pageable page);

  Mono<Person> findByFirstnameAndLastname(String firstname, String lastname);

  Mono<Person> findFirstByLastname(String lastname);

  @Query("{ \"bool\" : { \"must\" : { \"term\" : { \"lastname\" : \"?0\" } } } }")
  Flux<Person> findByLastname(String lastname);

  Mono<Long> countByFirstname(String firstname)

  Mono<Boolean> existsByFirstname(String firstname)

  Mono<Long> deleteByFirstname(String firstname)
}

Original Pull Request: #235
2019-01-23 13:54:44 +01:00
Mark Paluch
21a010c65a DATAES-507 - Updated changelog. 2019-01-10 14:15:44 +01:00
Mark Paluch
5ff782ed42 DATAES-506 - Updated changelog. 2019-01-10 12:26:37 +01:00
Mark Paluch
9c4247c47c DATAES-505 - Updated changelog. 2019-01-10 11:01:22 +01:00
Mark Paluch
f3fb779923 DATAES-524 - Update copyright years to 2019. 2019-01-02 12:36:07 +01:00
zzt
e264bd7f84 DATAES-487 - Support for multi search API. 2018-12-21 15:26:14 +00:00
xhaggi
5ff6238399 DATAES-521 - Remove id-type specific repository implementations. 2018-12-19 16:27:16 +01:00
Mark Paluch
3abc3ab13b DATAES-518 - Polishing.
Extract variable.

Original pull request: #233.
2018-12-14 09:43:32 +01:00
Christoph Strobl
a1c139445f DATAES-518 - Use scroll for unpaged find operations in ReactiveElasticsearchTemplate.
We now use scroll instead of a max page size for unpaged queries.

Original pull request: #233.
2018-12-14 09:43:25 +01:00
Christoph Strobl
fae1125e2f DATAES-513 - After release cleanups. 2018-12-11 11:07:53 +01:00
Christoph Strobl
c2f0b5abef DATAES-513 - Prepare next development iteration. 2018-12-11 11:07:52 +01:00
Christoph Strobl
dda137989a DATAES-513 - Release version 3.2 M1 (Moore). 3.2.0.M1 2018-12-11 10:53:53 +01:00
Christoph Strobl
912ed1a8ee DATAES-513 - Prepare 3.2 M1 (Moore). 2018-12-11 10:53:11 +01:00
Christoph Strobl
c5acf161a0 DATAES-513 - Updated changelog. 2018-12-11 10:53:10 +01:00
Christoph Strobl
12b91885bc DATAES-516 - Add profile for release. 2018-12-11 10:49:12 +01:00
Christoph Strobl
a2fad72e86 DATAES-515 - Revert override of Elasticsearch's JarHell for tests.
This reverts commit 25b02f29a741aa659cb8e49ce1d4c85e43c72e84 as the upgrade to Elasticsearch 6.5 made the changes obsolete.
2018-12-11 08:28:03 +01:00
Christoph Strobl
d8f43d3297 DATAES-512 - Polishing.
Update Javadoc and Readme to reflect recent back ports.
2018-12-11 08:27:44 +01:00
Christoph Strobl
a3a46b2e11 DATAES-510 - Add tests for resource clean up.
Original Pull Request: #231
2018-12-11 07:17:10 +01:00
Mark Paluch
b50e60fdd1 DATAES-510 - Polishing.
Wrap Scroll execution with usingWhen and run cleanup through usingWhen callback to clean up scrolls state on success/on error/on cancellation.

Extract isEmpty(SearchHits) check into own method. Improve synchronization in ScrollState to prevent concurrent modification exceptions during read.

Original Pull Request: #231
2018-12-11 07:17:10 +01:00
Christoph Strobl
da9de6bc49 DATAES-510 - Add reactive scroll support.
The ReactiveElasticsearchClient now support scrolling through large result sets issuing subsequent _search/scroll requests while emitting data on the outbound channel. Resources bound via their scrollId get freed on completion of the flux.

Original Pull Request: #231
2018-12-11 07:17:10 +01:00
Christoph Strobl
ce124a2d9e DATAES-512 - Fix request parameters not getting added to the URI as query string parameters.
We now make sure to include request parameters in the constructed URI and add potential request option headers.
2018-12-11 07:17:10 +01:00
Christoph Strobl
1ea73d2fb9 DATAES-504 - Update documentation.
Update documentation to cover newly added configuration options for the ReactiveElasticsearchClient.
Make sure to apply postFilter correctly and set a default limit for unpaged search requests.

Also fix some code format issues.
2018-12-11 07:17:10 +01:00
Mark Paluch
2dcd1cfbad DATAES-504 - Add configuration options for logging and timeouts to ReactiveElasticsearchClient.
We now log HTTP requests and responses with the org.springframework.data.elasticsearch.client.WIRE logger for both, the HighLevelRestClient and our reactive client and associate a logging Id for improved traceability.

Configuration of connection/socket timeouts is now available via the ClientConfiguration.

Along the lines we also aligned entity handling to EntityOperations already common in other modules. EntityOperations centralizes how aspects of entities (versioning, retrieval of index name/index type) are handled.

Original Pull Request: #229
2018-12-11 07:17:10 +01:00
Christoph Strobl
ba890cb7eb DATAES-504 - Add ReactiveElasticsearchOperations & ReactiveElasticsearchTemplate
ReactiveElasticsearchOperations is the gateway to executing high level commands against an Elasticsearch cluster using the ReactiveElasticsearchClient.

The ReactiveElasticsearchTemplate is the default implementation of ReactiveElasticsearchOperations and offers the following set of features.

* Read/Write mapping support for domain types.
* A rich query and criteria api.
* Resource management and Exception translation.

To get started the ReactiveElasticsearchTemplate needs to know about the actual client to work with.
The easiest way of setting up the ReactiveElasticsearchTemplate is via AbstractReactiveElasticsearchConfiguration providing
dedicated configuration method hooks for base package, the initial entity set etc.

@Configuration
public class Config extends AbstractReactiveElasticsearchConfiguration {

    @Bean
    @Override
    public ReactiveElasticsearchClient reactiveElasticsearchClient() {
        // ...
    }
}

NOTE: If applicable set default HttpHeaders via the ClientConfiguration of the ReactiveElasticsearchClient.

TIP: If needed the ReactiveElasticsearchTemplate can be configured with default RefreshPolicy and IndicesOptions that get applied to the related requests by overriding the defaults of refreshPolicy() and indicesOptions().

The ReactiveElasticsearchTemplate lets you save, find and delete your domain objects and map those objects to documents stored in Elasticsearch.

@Document(indexName = "marvel", type = "characters")
public class Person {

    private @Id String id;
    private String name;
    private int age;

    // Getter/Setter omitted...
}

template.save(new Person("Bruce Banner", 42)) // save a new document
    .doOnNext(System.out::println)
    .flatMap(person -> template.findById(person.id, Person.class)) // then go find it
    .doOnNext(System.out::println)
    .flatMap(person -> template.delete(person)) // just to remove remove it again
    .doOnNext(System.out::println)
    .flatMap(id -> template.count(Person.class)) // so we've got nothing at the end
    .doOnNext(System.out::println)
    .subscribe(); // yeah :)

The above outputs the following sequence on the console.

> Person(id=QjWCWWcBXiLAnp77ksfR, name=Bruce Banner, age=42)
> Person(id=QjWCWWcBXiLAnp77ksfR, name=Bruce Banner, age=42)
> QjWCWWcBXiLAnp77ksfR
> 0

Original Pull Request: #229
2018-12-11 07:17:10 +01:00
Christoph Strobl
a39c34058b DATAES-488 - Polishing & Documentation.
Rename VerificationMode -> Verification. Reorder methods in ReactiveElasticsearchClient, add test for DefaultWebClientProvider. Enforce assertions and fix some overall code style issues.
Add client reference documentation section.
2018-12-11 07:17:10 +01:00
Mark Paluch
390d7e8273 DATAES-488 - Polishing.
Convert spaces to tabs for pom.xml. Switch reactive dependencies to optional. Remove unused commonscollections property. Use managed versions for reactor and Spring dependencies.

Introduce WebClientProvider to avoid reinstantiation of WebClient instances. Introduce ClientConfiguration to encapsulate common Elasticsearch client configuration properties. Split ElasticsearchClients into RestClients and ReactiveRestClients to avoid mandatory dependency on WebFlux/Project Reactor. Adapt tests and code referring to WebClient creation.

Extract response body as byte array instead of Flux of DataBuffer to avoid chunking and to parse an entire response.

Encapsulate hostAndPort string used across configuration/HostProvider with InetSocketAddress. Add parser for InetSocketAddress.

Original Pull Request: #226
2018-12-11 07:17:10 +01:00