740 Commits

Author SHA1 Message Date
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
Christoph Strobl
691a8c57bc DATAES-488 - Add reactive Elasticsearch client support.
Initial implementation of a ReactiveElasticsearchClient using WebClient to connect to cluster nodes.

ReactiveElasticsearchClient client = ElasticsearchClients.createClient()
  .connectedTo("http://localhost:9200", "http://localhost:9201")
  .reactive();
A HostProvider selects active nodes and routes requests.

client.index(request ->

  request.index("spring-data")
    .type("elasticsearch")
    .id(randomUUID().toString())
    .source(singletonMap("feature", "reactive-client"))
    .setRefreshPolicy(IMMEDIATE);
);
This implementation provides the first building block for reactive Template and Repository support to be added subsequently.

Along the lines we upgraded to Elasticsearch 6.5.

Original Pull Request: #226
2018-12-11 07:17:10 +01:00
Mark Paluch
25b02f29a7 DATAES-515 - Override Elasticsearch's JarHell for tests. 2018-12-10 18:39:26 +01:00
Mark Paluch
c5f01807e3 DATAES-514 - Simplify reference documentation setup. 2018-12-10 10:06:41 +01:00
Christoph Strobl
f89c3a0e20 DATAES-508 - Set up travis-ci build. 2018-11-28 13:21:22 +01:00
Mark Paluch
8765485779 DATAES-496 - Updated changelog. 2018-11-27 14:54:09 +01:00
Mark Paluch
11b341884e DATAES-490 - Updated changelog. 2018-11-27 12:36:49 +01:00
Mark Paluch
a373f4f8a5 DATAES-491 - Updated changelog. 2018-11-27 11:27:24 +01:00
tsallase
0469a3c7be DATAES-445 - Updated scroll API example.
Original pull request: #218
2018-11-20 11:50:11 +01:00
xhaggi
89d0633fd5 DATAES-33 - Polishing
* Move @Parent property recognition to ElasticsearchPersistentProperty
* Move type contraints for @Version and @Parent fields to ElasticsearchPersistentProperty to fail faster
* remove unused constant SUPPORTED_ID_TYPES from SimpleElasticsearchPersistentProperty

Original pull request: #208
2018-11-20 11:45:26 +01:00
xhaggi
527f669f76 DATAES-503 - Added missing copy_to property to @Field annotation.
Original pull request: #227
2018-11-20 11:23:05 +01:00
xhaggi
dcf4cbe32a DATAES-492 - Add missing normalizer property to @Field and @InnerField.
Original pull request: #222
2018-11-20 09:21:51 +01:00
Artur Konczak
86c45eff81 DATAES-499 - Fix build - jar hell 2018-11-09 11:46:25 +00:00
Mark Paluch
8cb36e4181 DATAES-489 - Updated changelog. 2018-10-29 14:34:36 +01:00
Mark Paluch
2dd025d43b DATAES-486 - Updated changelog. 2018-10-15 11:37:25 +02:00
Artur Konczak
32a4f4ea7a DATAES-407 - improved tests for rest/transport template 2018-09-29 10:12:57 +01:00
Artur Konczak
4d4a6390e1 DATAES-407 - removed dependency with apache commons 2018-09-29 10:12:57 +01:00
Don Wellington
2f0b9b718b DATAES-407 - Support for HighLevelRestClient via ElasticsearchRestTemplate
Original pull request: #216
2018-09-29 10:10:54 +01:00
Mark Paluch
9c2f876bde DATAES-480 - After release cleanups. 2018-09-21 07:45:29 -04:00
Mark Paluch
786afa445f DATAES-480 - Prepare next development iteration. 2018-09-21 07:45:27 -04:00
Mark Paluch
5a50114b73 DATAES-480 - Release version 3.1 GA (Lovelace). 3.1.0.RELEASE 2018-09-21 07:08:39 -04:00
Mark Paluch
45a9384d4f DATAES-480 - Prepare 3.1 GA (Lovelace). 2018-09-21 07:07:51 -04:00
Mark Paluch
789acdc3dc DATAES-480 - Updated changelog. 2018-09-21 07:07:49 -04:00
Mark Paluch
946a60d24d DATAES-473 - Updated changelog. 2018-09-10 14:15:51 +02:00
Mark Paluch
838776dd63 DATAES-474 - Updated changelog. 2018-09-10 10:20:58 +02:00
jnizet
b8324f9205 DATAES-479 - Allow specifying a HighlightBuilder when creating a query.
Original pull request: #217.
2018-08-24 15:59:12 +02:00
Oliver Gierke
94d18e8111 DATAES-472 - After release cleanups. 2018-08-20 10:56:53 +02:00