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 asi123 <or...@yahoo.com> on 2012/01/23 19:40:55 UTC

Oregon (OR) cities facet query issue, maybe related to OR being a reserved word?

Hi,

I would really appreciate any hint/guide to fix this query issue. A Java
webapp hits solr with a query that does not returns any result but works for
other states. (FL, CA for instance)
>From logs:
[code]
solr path=/select
params={facet=on&facet.mincount=5&facet.sort=count&q=listing.property.state:"OR"&facet.limit=12&facet.field=listing.property.city_fStr&wt=javabin&rows=0&version=2}
hits=0 status=0 QTime=0
[/code]

>From searching the web, I also tried:
listing.property.state:OR
listing.property.state:\"OR\"
listing.property.state:\"+OR\"
listing.property.state:+OR
and probably multiple combinations of the above
returning facet count = 0
There are results for Oregon, also tried facet.mincount=1 (Portland includes
30+ results in my dev laptop)
I would say the issue is with q=listing.property.state:"OR"

I also tried removing
or
from stopswords.txt
but kept getting 0 count

All this was tested using Solr 3.5.0

I'm clueless here, any help will be greatly appreciated.

Best Regards,
Asi

--
View this message in context: http://lucene.472066.n3.nabble.com/Oregon-OR-cities-facet-query-issue-maybe-related-to-OR-being-a-reserved-word-tp3682633p3682633.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: Oregon (OR) cities facet query issue, maybe related to OR being a reserved word?

Posted by "Ritzman, James" <jr...@firstam.com>.
Hello,

I'm no expert here (just started learning/using Solr a few months ago) but I ran into the same issue of needing to search for and facet on the OR abbreviation.

What worked for me was to double-escape OR (a la :\\OR) for queries and single escape (:\OR) when doing a facet query.

The page http://stackoverflow.com/questions/5890401/sunspot-solr-queries-ending-with-logical-operators-and-or-not-result-in-error led me to the solution.

James 

-----Original Message-----
From: asi123 [mailto:orly_otero@yahoo.com] 
Sent: Monday, January 23, 2012 10:41 AM
To: solr-user@lucene.apache.org
Subject: Oregon (OR) cities facet query issue, maybe related to OR being a reserved word?

Hi,

I would really appreciate any hint/guide to fix this query issue. A Java
webapp hits solr with a query that does not returns any result but works for
other states. (FL, CA for instance)
>From logs:
[code]
solr path=/select
params={facet=on&facet.mincount=5&facet.sort=count&q=listing.property.state:"OR"&facet.limit=12&facet.field=listing.property.city_fStr&wt=javabin&rows=0&version=2}
hits=0 status=0 QTime=0
[/code]

>From searching the web, I also tried:
listing.property.state:OR
listing.property.state:\"OR\"
listing.property.state:\"+OR\"
listing.property.state:+OR
and probably multiple combinations of the above
returning facet count = 0
There are results for Oregon, also tried facet.mincount=1 (Portland includes
30+ results in my dev laptop)
I would say the issue is with q=listing.property.state:"OR"

I also tried removing
or
from stopswords.txt
but kept getting 0 count

All this was tested using Solr 3.5.0

I'm clueless here, any help will be greatly appreciated.

Best Regards,
Asi

--
View this message in context: http://lucene.472066.n3.nabble.com/Oregon-OR-cities-facet-query-issue-maybe-related-to-OR-being-a-reserved-word-tp3682633p3682633.html
Sent from the Solr - User mailing list archive at Nabble.com.
****************************************************************************************** 
This message may contain confidential or proprietary information intended only for the use of the 
addressee(s) named above or may contain information that is legally privileged. If you are 
not the intended addressee, or the person responsible for delivering it to the intended addressee, 
you are hereby notified that reading, disseminating, distributing or copying this message is strictly 
prohibited. If you have received this message by mistake, please immediately notify us by 
replying to the message and delete the original message and any copies immediately thereafter. 

Thank you.- 
******************************************************************************************
FAFLD


Re: Oregon (OR) cities facet query issue, maybe related to OR being a reserved word?

Posted by Ahmet Arslan <io...@yahoo.com>.
> I would really appreciate any hint/guide to fix this query
> issue. A Java
> webapp hits solr with a query that does not returns any
> result but works for
> other states. (FL, CA for instance)
> From logs:
> [code]
> solr path=/select
> params={facet=on&facet.mincount=5&facet.sort=count&q=listing.property.state:"OR"&facet.limit=12&facet.field=listing.property.city_fStr&wt=javabin&rows=0&version=2}
> hits=0 status=0 QTime=0
> [/code]
> 
> From searching the web, I also tried:
> listing.property.state:OR
> listing.property.state:\"OR\"
> listing.property.state:\"+OR\"
> listing.property.state:+OR
> and probably multiple combinations of the above
> returning facet count = 0
> There are results for Oregon, also tried facet.mincount=1
> (Portland includes
> 30+ results in my dev laptop)
> I would say the issue is with
> q=listing.property.state:"OR"
> 
> I also tried removing
> or
> from stopswords.txt
> but kept getting 0 count
> 
> All this was tested using Solr 3.5.0
> 
> I'm clueless here, any help will be greatly appreciated.

OR is a reserved word in lucene query parser. You can try other query parser like term query parser plugin. 

q={!term f=listing.property.state}OR

http://lucene.apache.org/solr/api/org/apache/solr/search/TermQParserPlugin.html