For anyone having this issue in the future:

I managed to narrow it down to Solr-RA 3.5. Installing Solr 3.5 solved the
issue. I don't really know how the internals of Solr-RA work, but it
appears that it was using AND operators even when I explicitly used OR
operators in the query. The other solution was to set defaultOperator to
OR, but I wasn't sure how this would affect my other queries. Would
explicit AND operators now become OR operators?

Anyway, thanks to Erik for helping me troubleshoot this!
--
Steven Ou | 歐偉凡

*ravn.com* | Chief Technology Officer
steve...@gmail.com | +1 909-569-9880


On Thu, Feb 9, 2012 at 5:14 PM, Erik Hatcher <erik.hatc...@gmail.com> wrote:

>
> On Feb 9, 2012, at 20:11 , Steven Ou wrote:
>
> > Sorry, what do you mean "explicit category rather than boolean
> expression"?
>
> q=category_ids_im:634 for example.  Just to get an idea of what matches
> each category.
>
> > Type was not changed midstream - hasn't really been changed ever, really.
> > And I happen to have *just* reindexed, too.
> >
> > Don't seem to have a default operator set. Not sure how to do it,
> either...?
>
> Look at Solr's example schema.xml.  It'll have it spelled out there.
>
>        Erik
>
>
> > --
> > Steven Ou | 歐偉凡
> >
> > *ravn.com* | Chief Technology Officer
> > steve...@gmail.com | +1 909-569-9880
> >
> >
> > On Thu, Feb 9, 2012 at 5:01 PM, Erik Hatcher <erik.hatc...@gmail.com>
> wrote:
> >
> >> Extremely odd.
> >>
> >> Hmmm... other things to try:
> >>
> >> * query on an explicit category, rather than in a boolean expression
> >> * try a different field type than sint (say just int, or string)
> >> * shouldn't matter (since you're using "OR" explicitly) but double check
> >> the default operator in schema.xml
> >> * reindex (was the field type ever changed mid-stream?)
> >>
> >> Definitely something fishy here.  Nothing obvious pops out yet.
> >>
> >>       Erik
> >>
> >>
> >> On Feb 9, 2012, at 19:53 , Steven Ou wrote:
> >>
> >>> Actually, I take that back. Using q instead of fq still produces the
> same
> >>> problem. Somehow it's *less* inconsistent so at first glance it looked
> >> like
> >>> it fixed it. However, it does *not* fix it :(
> >>> --
> >>> Steven Ou | 歐偉凡
> >>>
> >>> *ravn.com* | Chief Technology Officer
> >>> steve...@gmail.com | +1 909-569-9880
> >>>
> >>>
> >>> On Thu, Feb 9, 2012 at 4:48 PM, Steven Ou <steve...@gmail.com> wrote:
> >>>
> >>>> Well, keeping all other filter queries the same, changing fq=
> >>>> category_ids_im:(637+OR+639) to fq=category_ids_im:(637+OR+639+OR+634)
> >>>> causes results to not show up.
> >>>>
> >>>> In fact, I took out *all* other filter queries. And while I wasn't
> able
> >>>> to reproduce it exactly, nonetheless when I added the third category
> id
> >> the
> >>>> number of results *went down*. Which is consistently inconsistent, per
> >>>> se. Adding an OR cannot, logically, reduce the number of results!
> >>>> --
> >>>> Steven Ou | 歐偉凡
> >>>>
> >>>> *ravn.com* | Chief Technology Officer
> >>>> steve...@gmail.com | +1 909-569-9880
> >>>>
> >>>>
> >>>>
> >>>> On Thu, Feb 9, 2012 at 4:39 PM, Erik Hatcher <erik.hatc...@gmail.com
> >>> wrote:
> >>>>
> >>>>> Yes, certainly should work fine as a filter query... I was merely
> >> trying
> >>>>> to eliminate variables from the equation.  You've got several filters
> >> and a
> >>>>> q=*:* going on below, so it's obviously harder to pinpoint what could
> >> be
> >>>>> going wrong.  I suggest continuing to eliminate variables here, as
> more
> >>>>> than likely some other filter is causing the documents you think
> should
> >>>>> appear to be filtered out.
> >>>>>
> >>>>>      Erik
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Feb 9, 2012, at 19:24 , Steven Ou wrote:
> >>>>>
> >>>>>> By turning fq=category_ids_im:(637+OR+639+OR+634) to
> >>>>>> q=category_ids_im:(637+OR+639+OR+634)
> >>>>>> it appears to produce the correct results. But... that doesn't seem
> to
> >>>>> make
> >>>>>> sense to me? Shouldn't it work just fine as a filter query?
> >>>>>> --
> >>>>>> Steven Ou | 歐偉凡
> >>>>>>
> >>>>>> *ravn.com* | Chief Technology Officer
> >>>>>> steve...@gmail.com | +1 909-569-9880
> >>>>>>
> >>>>>>
> >>>>>> On Thu, Feb 9, 2012 at 4:20 PM, Steven Ou <steve...@gmail.com>
> wrote:
> >>>>>>
> >>>>>>> I don't really know how to analyze the debug output... Here it is
> for
> >>>>> the
> >>>>>>> full query I'm running, which includes other filter queries.
> >>>>>>>
> >>>>>>> <lst name="debug">
> >>>>>>> <str name="rawquerystring">*:*</str>
> >>>>>>> <str name="querystring">*:*</str>
> >>>>>>> <str name="parsedquery">MatchAllDocsQuery(*:*)</str>
> >>>>>>> <str name="parsedquery_toString">*:*</str>
> >>>>>>> <lst name="explain"/>
> >>>>>>> <str name="QParser">LuceneQParser</str>
> >>>>>>> <arr name="filter_queries">
> >>>>>>> <str>type:Event</str>
> >>>>>>> <str>displayable_b:true</str>
> >>>>>>> <str>category_ids_im:(637 OR 639 OR 634)</str>
> >>>>>>> <str>end_datetime_dt:[2012\-02\-10T00\:17\:52Z TO *]</str>
> >>>>>>> <str>{!geofilt}</str>
> >>>>>>> </arr>
> >>>>>>> <arr name="parsed_filter_queries">
> >>>>>>> <str>type:Event</str>
> >>>>>>> <str>displayable_b:true</str>
> >>>>>>> <str>
> >>>>>>> category_ids_im:637 category_ids_im:639 category_ids_im:634
> >>>>>>> </str>
> >>>>>>> <str>end_datetime_dt:[1328833072000 TO *]</str>
> >>>>>>> <str>
> >>>>>>>
> >>>>>>>
> >>>>>
> >>
> SpatialDistanceQuery(geofilt(latlonSource=coordinates_lls(double(coordinates_lls_0_coordinate),double(coordinates_lls_1_coordinate)),latCenter=37.7561438,lonCenter=-122.4325682,dist=50.0,latMin=37.30648363225355,latMax=38.20580396774645,lonMin=-123.0013021058511,lonMax-121.86383429414894,lon2Min=-180.0,lon2Max180.0,calcDist=true,planetRadius=6371.009))
> >>>>>>> </str>
> >>>>>>> </arr>
> >>>>>>> <lst name="timing">
> >>>>>>> <double name="time">1.0</double>
> >>>>>>> <lst name="prepare">
> >>>>>>> <double name="time">1.0</double>
> >>>>>>> <lst name="org.apache.solr.handler.component.QueryComponent">
> >>>>>>> <double name="time">1.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.FacetComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst
> name="org.apache.solr.handler.component.MoreLikeThisComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.HighlightComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.StatsComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.DebugComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> </lst>
> >>>>>>> <lst name="process">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> <lst name="org.apache.solr.handler.component.QueryComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.FacetComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst
> name="org.apache.solr.handler.component.MoreLikeThisComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.HighlightComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.StatsComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> <lst name="org.apache.solr.handler.component.DebugComponent">
> >>>>>>> <double name="time">0.0</double>
> >>>>>>> </lst>
> >>>>>>> </lst>
> >>>>>>> </lst>
> >>>>>>> </lst>
> >>>>>>> --
> >>>>>>> Steven Ou | 歐偉凡
> >>>>>>>
> >>>>>>> *ravn.com* | Chief Technology Officer
> >>>>>>> steve...@gmail.com | +1 909-569-9880
> >>>>>>>
> >>>>>>>
> >>>>>>> On Thu, Feb 9, 2012 at 4:15 PM, Steven Ou <steve...@gmail.com>
> >> wrote:
> >>>>>>>
> >>>>>>>> Heh, yeah, I bolded the numbers for emphasis. The field type
> >> follows.
> >>>>>>>>
> >>>>>>>> *Dynamically Created From Pattern: **_IM<
> >>>>> http://192.168.1.30:8080/solr/admin/schema.jsp#>
> >>>>>>>>
> >>>>>>>> *Field Type: *SINT <
> http://192.168.1.30:8080/solr/admin/schema.jsp#
> >>>
> >>>>>>>>
> >>>>>>>> *Schema: *Indexed, Multivalued, Omit Norms
> >>>>>>>>
> >>>>>>>> *Index: *(unstored field)
> >>>>>>>>
> >>>>>>>> *Index Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer
> >>>>>>>>
> >>>>>>>> *Query Analyzer: *org.apache.solr.schema.FieldType$DefaultAnalyzer
> >>>>>>>>
> >>>>>>>> *Docs: *33730
> >>>>>>>>
> >>>>>>>> *Distinct: *528
> >>>>>>>> --
> >>>>>>>> Steven Ou | 歐偉凡
> >>>>>>>>
> >>>>>>>> *ravn.com* | Chief Technology Officer
> >>>>>>>> steve...@gmail.com | +1 909-569-9880
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On Thu, Feb 9, 2012 at 4:08 PM, Erik Hatcher <
> >> erik.hatc...@gmail.com
> >>>>>> wrote:
> >>>>>>>>
> >>>>>>>>> What type of field is category_ids_im?
> >>>>>>>>>
> >>>>>>>>> And I'm assuming that the *'s below are for emphasis and not
> really
> >>>>> in
> >>>>>>>>> your query?
> >>>>>>>>>
> >>>>>>>>> Try your query in the q parameter and turn on debug
> >>>>> (&debugQuery=true)
> >>>>>>>>> and see how your query is parsing.  That'll likely tell all.
> >>>>>>>>>
> >>>>>>>>>     Erik
> >>>>>>>>>
> >>>>>>>>> On Feb 9, 2012, at 18:42 , Steven Ou wrote:
> >>>>>>>>>
> >>>>>>>>>> Hey guys, I'm stumped - hope someone can help!
> >>>>>>>>>>
> >>>>>>>>>> Basically, I'm running a filter query that filters by category
> >> (e.g.
> >>>>>>>>>> fq=category_ids_im:(637 OR 639 OR 634)). However, it often
> >> produces
> >>>>> no
> >>>>>>>>>> results whatsoever even though each individual query *does*
> >> produce
> >>>>>>>>> results.
> >>>>>>>>>>
> >>>>>>>>>> So, for example, fq=category_ids_im:*637* produces
> >>>>>>>>>> results. fq=category_ids_im:*639* produces results.
> >>>>>>>>>> fq=category_ids_im:*634* produces
> >>>>>>>>>> results. Even fq=category_ids_im:(*637* OR *639*) produces
> >> results,
> >>>>> as
> >>>>>>>>> well
> >>>>>>>>>> as fq=category_ids_im:(*639* OR *634*).
> >>>>>>>>>>
> >>>>>>>>>> BUT as soon as I do fq=category_ids_im:(*637* OR *639* OR
> *634*),
> >> it
> >>>>>>>>>> produces NO RESULTS!
> >>>>>>>>>>
> >>>>>>>>>> Any ideas what might be wrong? Really appreciate any help!
> >>>>>>>>>> --
> >>>>>>>>>> Steven Ou | 歐偉凡
> >>>>>>>>>>
> >>>>>>>>>> *ravn.com* | Chief Technology Officer
> >>>>>>>>>> steve...@gmail.com | +1 909-569-9880
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>
> >>
> >>
>
>

Reply via email to