You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Leonardo Souza <le...@gmail.com> on 2011/05/05 01:38:15 UTC

Field names with a period (.)

Hi guys,

Can i have a field name with a period(.) ?
Like in *file.size*

thanks!

[ ]'s
Leonardo da S. Souza
 °v°   Linux user #375225
 /(_)\   http://counter.li.org/
 ^ ^

Re: Field names with a period (.)

Posted by Gora Mohanty <go...@mimirtech.com>.
On Sat, May 7, 2011 at 1:29 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : I remember the same, except I think I've seen the recommendation that you
> : make all the letters lower-case. As I remember, there are some interesting
> : edge cases that you might run into later with upper case.
>
> i can't think of *any* reason why upper case character names i na field
> would cause you problems.
[...]

Will second that in so far as we have been using camelCase
for several months now without issues. I would like to hear
about any edge cases here.

Other than that, we have always stuck to a-z, A-Z, so I
cannot comment directly from experience about any
issues with other characters.

Regards,
Gora

Re: Field names with a period (.)

Posted by Chris Hostetter <ho...@fucit.org>.
: I remember the same, except I think I've seen the recommendation that you
: make all the letters lower-case. As I remember, there are some interesting
: edge cases that you might run into later with upper case.

i can't think of *any* reason why upper case character names i na field 
would cause you problems.

In general, the low level guts of SOlr don't care what characters you use 
i na field name.

where people run into problems is that some specific features of solr 
either have limitiations in what they can deal with in a field name, or 
work in some wya that makes certain characters extremely frustrating to 
use.

the simplest example of frustration is in needing to URL escape any 
special characters when building a URL that contains a field name (ie: as 
the value of a facet.field param for example)

an example of a hard limitation is sorting: the sort param expects 
whitespace seperated lists of "<fieldname> <asc|desc>" pairs -- if your 
field name contains whitespace, that can screw you up.

the lucene QueryParser is another situation where punctuation and 
whitespace are significant, so having those characters in your field names 
may cause your problems (i think in most cases they can be backslash 
escaped, but i'm not certain)

As far as the specific question about "." in field names -- i can't think 
of any feature that would break on that ... the only thing that comes to 
mind as a possibility is using per-field override params (ie: if the field 
name is "foo.bar" and you want to use 
facet.field=foo.bar&f.foo.bar.facet.prefix=xxx) ... but even then, i'm 
pretty sure it would work fine (you and the other people maintaining your 
code might get really confused however)


-Hoss

Re: Field names with a period (.)

Posted by Erick Erickson <er...@gmail.com>.
I remember the same, except I think I've seen the recommendation that you
make all the letters lower-case. As I remember, there are some interesting
edge cases that you might run into later with upper case.

But I can't remember the specifics either....

Erick

On Thu, May 5, 2011 at 10:08 AM, Leonardo Souza <le...@gmail.com> wrote:
> Thanks Gora!
>
> [ ]'s
> Leonardo da S. Souza
>  °v°   Linux user #375225
>  /(_)\   http://counter.li.org/
>  ^ ^
>
>
>
> On Thu, May 5, 2011 at 3:09 AM, Gora Mohanty <go...@mimirtech.com> wrote:
>
>> On Thu, May 5, 2011 at 5:08 AM, Leonardo Souza <le...@gmail.com>
>> wrote:
>> > Hi guys,
>> >
>> > Can i have a field name with a period(.) ?
>> > Like in *file.size*
>>
>> Cannot find now where this is documented, but from what I remember it is
>> recommended to use only characters A-Z, a-z, 0-9, and underscore (_) in
>> field names, and some special characters are known to cause problems.
>>
>> Regards,
>> Gora
>>
>

Re: Field names with a period (.)

Posted by Leonardo Souza <le...@gmail.com>.
Thanks Gora!

[ ]'s
Leonardo da S. Souza
 °v°   Linux user #375225
 /(_)\   http://counter.li.org/
 ^ ^



On Thu, May 5, 2011 at 3:09 AM, Gora Mohanty <go...@mimirtech.com> wrote:

> On Thu, May 5, 2011 at 5:08 AM, Leonardo Souza <le...@gmail.com>
> wrote:
> > Hi guys,
> >
> > Can i have a field name with a period(.) ?
> > Like in *file.size*
>
> Cannot find now where this is documented, but from what I remember it is
> recommended to use only characters A-Z, a-z, 0-9, and underscore (_) in
> field names, and some special characters are known to cause problems.
>
> Regards,
> Gora
>

Re: Field names with a period (.)

Posted by Gora Mohanty <go...@mimirtech.com>.
On Thu, May 5, 2011 at 5:08 AM, Leonardo Souza <le...@gmail.com> wrote:
> Hi guys,
>
> Can i have a field name with a period(.) ?
> Like in *file.size*

Cannot find now where this is documented, but from what I remember it is
recommended to use only characters A-Z, a-z, 0-9, and underscore (_) in
field names, and some special characters are known to cause problems.

Regards,
Gora