Forums / Extensions / eZ Find / Potential BC break for subattribute fields in eZ Find 2.3: input requested

Potential BC break for subattribute fields in eZ Find 2.3: input requested

Author Message

Paul Borgermans

Wednesday 16 June 2010 3:16:27 am

While field names in Solr are in principle fully unicode, there are some areas where hyphens (or dash '-') pose problems. This is used in particular with subattribute field names.

I want to change this convention and replace the hyphen with an underscore ('_').

Apart from a re-index need, this will break cases where you use hardcoded fields names in templates for example when using subattribute filtering.

I would like to have an idea how many of you use hard coded subattribute fields and your comments on this change

Regards

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Nicolas Pastorino

Wednesday 16 June 2010 3:34:28 am

Hi Paul and thanks for polling the community !

My two cents on the topic : The "-" (hyphen) separator was chosen to make a visual difference from the other separator used by eZ Find when building Solr field names : "_" (underscore). This helps a lot any developer to identify/qualify a field's origin, namely when reading direct outputs from Solr (console, Solr admin).

In short, having two different separators adds, in my opinion, a valuable semantic nuance, and i'd recommend choosing another, Solr-compliant character than "_" for this purpose.

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Paul Borgermans

Wednesday 16 June 2010 4:12:01 am

The point is to avoid special characters which are actually also part of the lucene query syntax:

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \

An alternatve is to use a pattern with multiple characters to aid human readability

For example

 _SUB_

as a separator

More thoughts?

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Ivo Lukac

Wednesday 16 June 2010 6:36:58 am

We have one project using this feature, put it will not be a problem to upgrade :)

Cheers.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Paul Borgermans

Wednesday 16 June 2010 1:41:19 pm

ok, last chance to influence me:

what about '___' which are three consecutive underscores?

examples:

submeta_related_article___class_name_s

subattr_related_article___body_t

Is that clear enough to see the attribute and subattribute identifiers?

Regards

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

gilles guirand

Wednesday 16 June 2010 7:50:07 pm

Enjoy the three consecutive underscores !

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr

Nicolas Pastorino

Wednesday 16 June 2010 11:40:30 pm

"

Enjoy the three consecutive underscores !

"

+1

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye