Raven server indexes booleans upper-case, but the client queries them lower-case

67 views
Skip to first unread message

Lars Corneliussen

unread,
Jun 9, 2012, 7:41:36 AM6/9/12
to rav...@googlegroups.com
When indexing boolean fields, "Terms" lists "False" and "False", but the client api generates field:true or field:false when using Query with expressions.
Workarround is to store boolean fields Analyzed - but that doesn't make to much sense...

Using build 701; is this fixed in never versions?

Oren Eini (Ayende Rahien)

unread,
Jun 9, 2012, 7:54:00 AM6/9/12
to rav...@googlegroups.com
Are you using a custom index?

Lars Corneliussen

unread,
Jun 9, 2012, 9:40:06 AM6/9/12
to rav...@googlegroups.com
Yes.

AddMap<Xyz>(
                fs => from h in fs
                      select new Result
                             {
                                 Bool = h.Transactions.Any()
                             });

var load = s.Query<Index.Result, Index>()
                    .Where(d => !d.Bool)
                    .AsProjection<Index.Result>();

_
Lars

Oren Eini (Ayende Rahien)

unread,
Jun 9, 2012, 10:19:30 AM6/9/12
to rav...@googlegroups.com
This is strange, can you show the full index def?

Lars Corneliussen

unread,
Jun 10, 2012, 1:44:05 PM6/10/12
to rav...@googlegroups.com
Was about to write a huge mail with lots of code, but when trying to prove the problem, the Terms suddenly showed "false" and "true", instead of "False" and "True".
Some more testing showed that this depends on if the field is set as analyzed or not. Analyzed -> lower-case, Not Analyzed -> upper case

But IMHO boolean fields should be indexed unanalyzed, as i do not want to find things with "t" or tr"... But I might be wrong.

Still want the code?

_
Lars

Oren Eini (Ayende Rahien)

unread,
Jun 11, 2012, 1:22:53 AM6/11/12
to rav...@googlegroups.com
No, if this is the case, than that is by design.
There is a difference between how we index things in the different modes.
For boolean fields, you are better off sticking with the Default, instead of messing with it.

Oren Eini (Ayende Rahien)

unread,
Jun 13, 2012, 12:07:34 AM6/13/12
to rav...@googlegroups.com
Are you using a custom index?

On Saturday, June 9, 2012, Lars Corneliussen wrote:
Reply all
Reply to author
Forward
0 new messages