Allow non-String values in environment configuration

Description

Hi there,

while trying to use

properties.put(Environment.INDEX_UNINVERTING_ALLOWED, true);

I have discovered that

org.hibernate.search.util.configuration.impl.ConfigurationParseHelper#getBooleanValue

uses

Properties.getProperty

which returns null when the property value is not a string (for whatever reason...).

In my case, this has the effect that using a boolean "true" INDEX_UNINVERTING_ALLOWED is not recognized and an exception is thrown instead as this is now the default. Using a string based

properties.put(Environment.INDEX_UNINVERTING_ALLOWED,"true");

IMHO, this is a pitfall that could be easily avoided by also allowing boolean values.

Activity

Show:

Niko Wittenbeck May 26, 2018 at 5:52 AM

Hehe, nice one 😀

Sanne Grinovero May 25, 2018 at 10:47 PM

Sanne Grinovero May 24, 2018 at 1:26 PM

+1 Let's remove Properties from Hibernate ORM 6 as well.

Yoann Rodière May 24, 2018 at 1:10 PM

My vote is to avoid Properties in future APIs evolutions, but yes let's explore some improvements already.

: We did push Properties under the carpet, only one or two classes deal with that in Search 6 now. Most APIs and SPIs are untainted by Properties. We still have to deal with it in some cases of course, since that's what Hibernate ORM provides us with.

Guillaume Smet May 24, 2018 at 12:49 PM

For the record:

It introduces a very strong performance penalty, and we hope to remove the option altogether.

It has been entirely removed from the Lucene backend of our future Search 6 and I don't plan in adding it back.

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Priority

Created May 24, 2018 at 11:05 AM
Updated January 31, 2019 at 3:08 PM
Resolved December 4, 2018 at 3:55 PM