Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Hibernate Search 6.0.0.Beta5 #7379

Merged
merged 4 commits into from
Feb 24, 2020

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Feb 24, 2020

@gsmet We also need to add this to the migration guide (I can't edit the wiki):

## Hibernate Search + Elasticsearch (Preview)

### Search DSL

A few methods in the Search DSL have been renamed:

* `searchSession.search(...).predicate(...)` becomes `searchSession.search(...).where(...)`.
* `searchSession.search(...).asProjection(...)` becomes `searchSession.search(...).select(...)`.
* `searchSession.search(...).asProjections(...)` becomes `searchSession.search(...).select(...)`.
* `searchSession.search(...).asEntity(...)` becomes `searchSession.search(...).selectEntity()`.
* `searchSession.search(...).asEntityReference(...)` becomes `searchSession.search(...).selectEntityReference()`.

The methods with the old name are still present, though deprecated.
They will be removed before Hibernate Search 6.0.0.Final is released.

### Index layout

Elasticsearch indexes are now accessed through aliases only.
Hibernate Search relies on two aliases for each index: one for writes (`<myindex>-write`) and one for reads (`<myindex>-read`).

As a result, you will need to either create the two aliases,
or drop your indexes and have Hibernate Search re-create empty indexes on startup: it will create the aliases.

See [this section of the reference documentation](https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#backend-elasticsearch-indexlayout)
for more information about index layout.

### Configuration

The names of synchronization strategies for automatic indexing have changed:

* `queued` => `async`.
* `committed` (the default) => `write-sync` (still the default).
* `searchable` (commonly used for tests) => `sync` (still recommended for tests only).

So if your configuration looked like this:

```
quarkus.hibernate-search.automatic_indexing.synchronization.strategy = queued
```

You should now have this:

```
quarkus.hibernate-search.automatic_indexing.synchronization.strategy = async
```

And if it looked like this:

```
quarkus.hibernate-search.automatic_indexing.synchronization.strategy = searchable
```

You should now have this:

```
quarkus.hibernate-search.automatic_indexing.synchronization.strategy = sync
```

See [this section of the reference documentation](https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#mapper-orm-indexing-automatic-synchronization) for more information about synchronization strategies.

@yrodiere yrodiere added the area/hibernate-search Hibernate Search label Feb 24, 2020
@yrodiere yrodiere requested a review from gsmet February 24, 2020 10:03
@yrodiere
Copy link
Member Author

I force-pushed an update restoring reflection on some GSON type adapters. I do not know why the native test for Data5 failed, it looks related to git. Can someone restart it? I don't think I can.

@yrodiere
Copy link
Member Author

@gsmet Fixed the remaining problems. The windows build is failing because of RestEasy?

[ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 12.916 s <<< FAILURE! - in io.quarkus.resteasy.test.NotFoundExceptionMapperTestCase
[ERROR] shouldNotDisplayDeletedFileIn404ErrorPage  Time elapsed: 3.68 s  <<< ERROR!
java.io.UncheckedIOException: 
java.nio.file.FileSystemException: D:\a\quarkus\quarkus\extensions\resteasy\deployment\target\quarkus-dev-mode-test6166822625422934302\src\main\resources\META-INF\resources\test.html: The process cannot access the file because it is being used by another process.

	at io.quarkus.test.QuarkusDevModeTest.deleteResourceFile(QuarkusDevModeTest.java:443)
	at io.quarkus.resteasy.test.NotFoundExceptionMapperTestCase.shouldNotDisplayDeletedFileIn404ErrorPage(NotFoundExceptionMapperTestCase.java:86)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)

@gsmet gsmet merged commit dd43758 into quarkusio:master Feb 24, 2020
@gsmet gsmet added this to the 1.3.0 milestone Feb 24, 2020
@gsmet
Copy link
Member

gsmet commented Feb 24, 2020

Merged, thanks!

@yrodiere yrodiere deleted the hsearch-6-beta5 branch May 17, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants