Skip to content

Commit

Permalink
Sync web site with Quarkus documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
quarkusbot committed Dec 4, 2024
1 parent 521b56a commit ea40545
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion _guides/_attributes.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Common attributes.
// --> No blank lines (it ends the document header)
:project-name: Quarkus
:quarkus-version: 3.17.2
:quarkus-version: 3.17.3
:quarkus-platform-groupid: io.quarkus.platform
// .
:maven-version: 3.9.9
Expand Down
25 changes: 11 additions & 14 deletions _guides/hibernate-search-orm-elasticsearch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -627,32 +627,29 @@ Edit `src/main/resources/application.properties` and inject the following config

[source,properties]
----
quarkus.ssl.native=false <1>
quarkus.datasource.db-kind=postgresql <1>
quarkus.datasource.db-kind=postgresql <2>
quarkus.hibernate-orm.sql-load-script=import.sql <2>
quarkus.hibernate-orm.sql-load-script=import.sql <3>
quarkus.hibernate-search-orm.elasticsearch.version=8 <3>
quarkus.hibernate-search-orm.indexing.plan.synchronization.strategy=sync <4>
quarkus.hibernate-search-orm.elasticsearch.version=8 <4>
quarkus.hibernate-search-orm.indexing.plan.synchronization.strategy=sync <5>
%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost/quarkus_test <6>
%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost/quarkus_test
%prod.quarkus.datasource.username=quarkus_test
%prod.quarkus.datasource.password=quarkus_test
%prod.quarkus.hibernate-orm.database.generation=create
%prod.quarkus.hibernate-search-orm.elasticsearch.hosts=localhost:9200 <6>
%prod.quarkus.hibernate-search-orm.elasticsearch.hosts=localhost:9200 <5>
----
<1> We won't use SSL, so we disable it to have a more compact native executable.
<2> Let's create a PostgreSQL datasource.
<3> We load some initial data on startup (see <<automatic-import-script>>).
<4> We need to tell Hibernate Search about the version of Elasticsearch we will use.
<1> Let's create a PostgreSQL datasource.
<2> We load some initial data on startup (see <<automatic-import-script>>).
<3> We need to tell Hibernate Search about the version of Elasticsearch we will use.
It is important because there are significant differences between Elasticsearch mapping syntax depending on the version.
Since the mapping is created at build time to reduce startup time, Hibernate Search cannot connect to the cluster to automatically detect the version.
Note that, for OpenSearch, you need to prefix the version with `opensearch:`; see <<opensearch>>.
<5> This means that we wait for the entities to be searchable before considering a write complete.
<4> This means that we wait for the entities to be searchable before considering a write complete.
On a production setup, the `write-sync` default will provide better performance.
Using `sync` is especially important when testing as you need the entities to be searchable immediately.
<6> For development and tests, we rely on <<dev-services,Dev Services>>,
<5> For development and tests, we rely on <<dev-services,Dev Services>>,
which means Quarkus will start a PostgreSQL database and Elasticsearch cluster automatically.
In production mode, however,
we will want to start a PostgreSQL database and Elasticsearch cluster manually,
Expand Down
19 changes: 8 additions & 11 deletions _guides/hibernate-search-standalone-elasticsearch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -559,31 +559,28 @@ Edit `src/main/resources/application.properties` and inject the following config

[source,properties]
----
quarkus.ssl.native=false <1>
quarkus.hibernate-search-standalone.mapping.structure=document <1>
quarkus.hibernate-search-standalone.elasticsearch.version=8 <2>
quarkus.hibernate-search-standalone.indexing.plan.synchronization.strategy=sync <3>
quarkus.hibernate-search-standalone.mapping.structure=document <2>
quarkus.hibernate-search-standalone.elasticsearch.version=8 <3>
quarkus.hibernate-search-standalone.indexing.plan.synchronization.strategy=sync <4>
%prod.quarkus.hibernate-search-standalone.elasticsearch.hosts=localhost:9200 <5>
%prod.quarkus.hibernate-search-standalone.elasticsearch.hosts=localhost:9200 <4>
----
<1> We won't use SSL, so we disable it to have a more compact native executable.
<2> We need to tell Hibernate Search about the structure of our entities.
<1> We need to tell Hibernate Search about the structure of our entities.
+
In this application we consider an indexed entity (the author) is the root of a "document":
the author "owns" books it references through associations,
which *cannot* be updated independently of the author.
+
See <<quarkus-hibernate-search-standalone-elasticsearch_quarkus-hibernate-search-standalone-mapping-structure,`quarkus.hibernate-search-standalone.mapping.structure`>> for other options and more details.
<3> We need to tell Hibernate Search about the version of Elasticsearch we will use.
<2> We need to tell Hibernate Search about the version of Elasticsearch we will use.
+
It is important because there are significant differences between Elasticsearch mapping syntax depending on the version.
Since the mapping is created at build time to reduce startup time, Hibernate Search cannot connect to the cluster to automatically detect the version.
Note that, for OpenSearch, you need to prefix the version with `opensearch:`; see <<opensearch>>.
<4> This means that we wait for the entities to be searchable before considering a write complete.
<3> This means that we wait for the entities to be searchable before considering a write complete.
On a production setup, the `write-sync` default will provide better performance.
Using `sync` is especially important when testing as you need the entities to be searchable immediately.
<5> For development and tests, we rely on <<dev-services,Dev Services>>,
<4> For development and tests, we rely on <<dev-services,Dev Services>>,
which means Quarkus will start an Elasticsearch cluster automatically.
In production mode, however,
we will want to start an Elasticsearch cluster manually,
Expand Down
21 changes: 16 additions & 5 deletions _guides/qute-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2994,10 +2994,9 @@ If there is a message bundle method that accepts a single parameter of an enum t
@Message <1>
String methodName(MyEnum enum);
----
<1> The value is intentionally not provided. There's also no key for the method in a localized file.

Then it receives a generated template:
<1> The value is intentionally not provided. There's also no key/value pair for this method in a localized file.

Then it receives a generated template like:
[source,html]
----
{#when enumParamName}
Expand All @@ -3006,15 +3005,27 @@ Then it receives a generated template:
{/when}
----

Furthermore, a special message method is generated for each enum constant. Finally, each localized file must contain keys and values for all constant message keys:
Furthermore, a special message method is generated for each enum constant.
Finally, each localized file must contain keys and values for all enum constants:

[source,poperties]
----
methodName_CONSTANT1=Value 1
methodName_CONSTANT2=Value 2
----

In a template, an enum constant can be localized with a message bundle method like `{msg:methodName(enumConstant)}`.
// We need to escape the first underscore
// See https://docs.asciidoctor.org/asciidoc/latest/subs/prevent/
[IMPORTANT]
.Message keys for enum constants
====
By default, the message key consists of the method name followed by the `\_` separator and the constant name.
If any constant name of a particular enum contains the `_` or the `$` character then the `\_$` separator must be used for all message keys for this enum instead.
For example, `methodName_$CONSTANT_1=Value 1` or `methodName_$CONSTANT$1=Value 1`.
A constant of a localized enum may not contain the `_$` separator.
====

In a template, the localized message for an enum constant can be obtained with a message bundle method like `{msg:methodName(enumConstant)}`.

TIP: There is also <<convenient-annotation-for-enums,`@TemplateEnum`>> - a convenient annotation to access enum constants in a template.

Expand Down

0 comments on commit ea40545

Please sign in to comment.