How to set eager_global_ordinals

I can’t find out how to set eager_global_ordinals in reference document.
Is there any way to set?

eager_global_ordinals is a server-side “setting”, more precisely it’s something that you set as part of the mapping definition when creating the Elasticsearch index.

If you rely on Hibernate Search to create your Elasticsearch indexes/mappings, then you can use = some-file.json to have Hibernate Search merge your custom configuration with the mapping it generates.

If you create your indexes/mappings yourself, well… just add that to your mapping definition.

1 Like

Right. I remember that setting for now.
Then, can I also set multifield mapping in mapping_file instead of workaround?

Not really. You can add multifields to the mapping, but Hibernate Search won’t know about them and will throw an error when you try to create predicates targeting those fields.

EDIT: There’s a warning about something very similar in the documentation I linked, by the way:

Properties that are only defined in the custom mappings file but not mapped by Hibernate Search will not be visible to Hibernate Search.

This means Hibernate Search will throw exceptions if you try to reference these properties in the Search DSL, or when writing to a document from a bridge

1 Like