Issue with State code Oregon(OR) in Query

27 views
Skip to first unread message

KoteswaraRao Ankalla

unread,
May 7, 2012, 2:13:21 AM5/7/12
to ravendb
Hi All,

We are getting below exception when we try to get projects from all
states in Pacific OmbDivision using dynamic lamda filter expression in
linq query, because of the state code "OR" for the state Oregon
This State code "OR" is getting messed-up with logical OR in the query
as follows.


Lucene.Net.QueryParsers.ParseException: Cannot parse
'(PrjLocation_StateCode:AK OR PrjLocation_StateCode:CA OR
PrjLocation_StateCode:HI OR PrjLocation_StateCode:OR OR
PrjLocation_StateCode:WA)': Encountered " <OR> "OR "" at line 1,
column 107.
Was expecting one of:
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...
---> Lucene.Net.QueryParsers.ParseException: Encountered " <OR>
"OR "" at line 1, column 107.
Was expecting one of:
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...



So would you mind to please give an advise to resolve this issue like
should we change the state code? or
Is there any work around for this?

Thanks,
Koti.

Oren Eini (Ayende Rahien)

unread,
May 7, 2012, 4:24:06 AM5/7/12
to rav...@googlegroups.com
Thanks for the bug report, this will be fixed in the next build, later today

Itamar Syn-Hershko

unread,
May 7, 2012, 10:46:07 AM5/7/12
to rav...@googlegroups.com
How did you fix that?

Lucene operators are case-sensitive, so basically looking for "or" instead of "OR" should do it, assuming you are using a lowercasing analyzer (which the default one is)

Oren Eini (Ayende Rahien)

unread,
May 7, 2012, 11:07:26 AM5/7/12
to rav...@googlegroups.com
State:"OR" works

KoteswaraRao Ankalla

unread,
May 8, 2012, 12:40:22 AM5/8/12
to rav...@googlegroups.com
Thanks for your info..
Can we take it now..?

Thanks,
Koti.
--

Thanks & Regards
KoteswaraRao A

Oren Eini (Ayende Rahien)

unread,
May 8, 2012, 2:03:43 AM5/8/12
to rav...@googlegroups.com
Yes

KoteswaraRao Ankalla

unread,
May 8, 2012, 5:21:12 AM5/8/12
to rav...@googlegroups.com
Hi Ayende and All,

We have updated below client dlls with latest ones today but we are
still getting the same exception with state Code "OR".
Raven.Abstractions.dll
Raven.Client.Lightweight.dll

So would you mind to please take a look and let us know your
instructions if any?

Thanks,
Koti.


On Tue, May 8, 2012 at 11:33 AM, Oren Eini (Ayende Rahien)

Oren Eini (Ayende Rahien)

unread,
May 8, 2012, 5:44:29 AM5/8/12
to rav...@googlegroups.com
What is the actual query being sent to the server?
It should be State:"OR"

KoteswaraRao Ankalla

unread,
May 8, 2012, 6:46:48 AM5/8/12
to rav...@googlegroups.com
Yes, we are using state code in uppercase as "OR". You can please
observe it in the exception that we gave in first post.

Thanks,
Koti.

On Tue, May 8, 2012 at 3:14 PM, Oren Eini (Ayende Rahien)

Oren Eini (Ayende Rahien)

unread,
May 9, 2012, 6:44:04 AM5/9/12
to rav...@googlegroups.com
Can you create a failing test? 
I have a passing test for that.

Oren Eini (Ayende Rahien)

unread,
May 9, 2012, 6:45:35 AM5/9/12
to rav...@googlegroups.com
public class Oregon : RavenTest
{
[Fact]
public void CanQueryForOregon()
{
using(var store = NewDocumentStore())
{
using(var session = store.OpenSession())
{
session.Query<User>()
.Where(x => x.LastName == "OR")
.ToList();
}
}
}
}


Make sure that you update the client to 926, mind

KoteswaraRao Ankalla

unread,
May 10, 2012, 12:33:16 AM5/10/12
to rav...@googlegroups.com
Hey Ayende,

We have updated dlls with latest ones yesterday and it is working fine for us.
Issue with state code "OR" is resolved now.

Thank you very much for your followups and help on this.

Thanks,
Koti.

On Wed, May 9, 2012 at 4:15 PM, Oren Eini (Ayende Rahien)
Reply all
Reply to author
Forward
0 new messages