-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Search: Fielddata is disabled on text fields
PostPosted: Mon Dec 04, 2017 8:03 am 
Newbie

Joined: Mon Dec 04, 2017 7:44 am
Posts: 1
Hi,

I attempted upgrade from Hibernate Search 5.8.0.CR1 to 5.8.2.Final
and from ElasticSearch 2.4.2 to 5.6.4.

When I run my application I'm getting the following error:

Code:
Status: 400 Bad Request
Error message: {"root_cause":[{"type":"illegal_argument_exception",
reason":"Fielddata is disabled on text fields by default.
Set fielddata=true on [title] in order to load fielddata in memory by uninverting the inverted index.
Note that this can however use significant memory. Alternatively use a keyword field instead."}]


I read about Fielddata here:
https://www.elastic.co/guide/en/elasticsearch/reference/5.6/fielddata.html#_fielddata_is_disabled_on_literal_text_literal_fields_by_default
But I'm not sure how to address this issue, especially from Hibernate Search.

My title field definition looks like this:

Code:
@Field(name = "title", analyzer = @Analyzer(definition = "my_collation_analyzer"))
@Field(name = "title_polish", analyzer = @Analyzer(definition = "polish"))
protected String title;

I'm using the following analyzer definition:

Code:
@AnalyzerDef(name = "my_collation_analyzer",
        tokenizer = @TokenizerDef(factory = KeywordTokenizerFactory.class), filters = { @TokenFilterDef(
                name = "polish_collation", factory = ElasticsearchTokenFilterFactory.class, params = {
                        @org.hibernate.search.annotations.Parameter(name = "type", value = "'icu_collation'"),
                        @org.hibernate.search.annotations.Parameter(name = "language", value = "'pl'") }) })


(Analyzer polish comes from plugin analysis-stempel.)


Elasticsearch notes on Fielddata recommend changing the type of the field
from text to keyword, or setting fielddata=true, but I'm not sure
how to do it using Hibernate Search annotations because there are no such
properties in annotation @Field.


Top
 Profile  
 
 Post subject: Re: Hibernate Search: Fielddata is disabled on text fields
PostPosted: Tue Jan 02, 2018 3:53 pm 
Hibernate Team
Hibernate Team

Joined: Thu Jan 05, 2017 6:04 am
Posts: 13
Hi,

If you can, I would recommend dropping your ES index and running the mass indexer to reindex all your entities.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.