Hibernate Search: Fielddata is disabled on text fields Hibernate Search: Fielddata is disabled on text fields elasticsearch elasticsearch

Hibernate Search: Fielddata is disabled on text fields


If you are trying to sort on the "title" field, then maybe you forgot to mark the field as sortable using the @SortableField annotation. (More information here) [EDIT: In Hibernate Search 6 you would use @KeywordField(sortable = Sortable.YES). See here]

Also, to avoid errors and for better performance, you should consider using normalizers instead of analyzers for fields you want to sort on (such as your "title" field). This will turn your field into a keyword field, which is what the Elasticsearch logs are hinting at.

More information on normalizers in Hibernate Search is available here, and here are the Elasticsearch specifics in Hibernate Search.


You most likely kept the old schema in your Elasticsearch cluster and tried to use it in Elasticsearch 5 with Hibernate Search. This will not work.

When upgrading from Elasticsearch 2 to 5, you must take some steps to upgrade the Elasticsearch schema, in order to use it with Hibernate Search. The easiest option (by far) is to delete the indexes and reindex your whole database. You can find details in the documentation: https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#_upgrading_elasticsearch

Note that you may also have to delete indexes and reindex if your Elasticsearch schema was generated from a Beta version of Hibernate Search: Beta versions are unstable, and may generate an incorrect schema. They are nice for experiments, but definitely not for production environments.