Weird issue with q.op=AND

2014-02-12 Thread Shamik Bandopadhyay
Hi,

  I'm facing a weird problem while using q.op=AND condition. Looks like it
gets into some conflict if I use multiple appends condition in
conjunction. It works as long as I've one filtering condition in appends.

lst name=appends
   str name=fqSource:TestHelp/str
/lst

Now, the moment I add an additional parameter, search stops returning any
result.

lst name=appends
   str name=fqSource:TestHelp | Source:TestHelp2/str
/lst

If I remove q.op=AND from request handler, I get results back. Data is
present for both the Source I'm using, so it's not a filtering issue. Even
a blank query fails to return data.

Here's my request handler.

requestHandler name=/testhandler class=solr.SearchHandler
lst name=defaults
str name=echoParamsexplicit/str
float name=tie0.01/float
str name=wtvelocity/str
str name=v.templatebrowse/str
str name=v.contentTypetext/html;charset=UTF-8/str
str name=v.layoutlayout/str
str name=v.channeltesthandler/str
str name=defTypeedismax/str
str name=q.opAND/str
str name=q.alt*:*/str
str name=rows15/str
str name=flid,url,Source2,text/str
str name=qftext^1.5 title^2/str
str name=bqSource:TestHelp^3 Source:TestHelp2^0.85/str
str name=bfrecip(ms(NOW/DAY,PublishDate),3.16e-11,1,1)^2.0/str
str name=dftext/str

!-- facets --
str name=faceton/str
str name=facet.mincount1/str
str name=facet.limit100/str
str name=facet.fieldlanguage/str
str name=facet.fieldSource/str
 !-- Highlighting defaults --
str name=hltrue/str
str name=hl.fltext title/str
str name=f.text.hl.fragsize250/str
str name=f.text.hl.alternateFieldShortDesc/str

!-- Spell check settings --
str name=spellchecktrue/str
str name=spellcheck.dictionarydefault/str
str name=spellcheck.collatetrue/str
str name=spellcheck.onlyMorePopularfalse/str
str name=spellcheck.extendedResultsfalse/str
str name=spellcheck.count1/str

   !-- Shard Tolerant --
str name=shards.toleranttrue/str
/lst
lst name=appends
str name=fqSource:TestHelp | Source2:TestHelp2/str
/lst
arr name=last-components
strspellcheck/str
/arr
/requestHandler

Not sure what's going wrong. I'm using a SolrCloud environment with 2
shards having a replica each.

Any pointers will be appreciated.

Thanks,
Shamik


Re: Weird issue with q.op=AND

2014-02-12 Thread Shawn Heisey

On 2/12/2014 3:32 PM, Shamik Bandopadhyay wrote:

Hi,

   I'm facing a weird problem while using q.op=AND condition. Looks like it
gets into some conflict if I use multiple appends condition in
conjunction. It works as long as I've one filtering condition in appends.

lst name=appends
str name=fqSource:TestHelp/str
/lst

Now, the moment I add an additional parameter, search stops returning any
result.

lst name=appends
str name=fqSource:TestHelp | Source:TestHelp2/str
/lst

If I remove q.op=AND from request handler, I get results back. Data is
present for both the Source I'm using, so it's not a filtering issue. Even
a blank query fails to return data.


I'm pretty sure that's not valid Solr query syntax for what you're 
trying to do.  Try this instead, although with these specific examples I 
would leave the quotes out of the fq value:


lst name=appends
   str name=fqSource:(TestHelp OR TestHelp2)/str
/lst

It's pretty much accidental (a result of the query analysis chain) that 
it was working when you didn't have q.op=AND.  You can verify what I'm 
saying by looking at the parsed query when adding debugQuery=true as a 
query option.


Thanks,
Shawn



Re: Weird issue with q.op=AND

2014-02-12 Thread shamik
Thanks a lot Shawn. Changing the appends filtering based on your suggestion
worked. The part which confused me bigtime is the syntax I've been using so
far without an issue (barring the q.op part).


lst name=appends 
 str name=fqSource:TestHelp | Source:downloads |
-AccessMode:internal | -workflowparentid:[* TO *]/str 
/lst

This has been working as expected and applies the filter correctly. Just
curious, if its an invalid syntax, how's Solr handling this ?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Weird-issue-with-q-op-AND-tp4117013p4117022.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Weird issue with q.op=AND

2014-02-12 Thread Shawn Heisey

On 2/12/2014 4:58 PM, shamik wrote:

Thanks a lot Shawn. Changing the appends filtering based on your suggestion
worked. The part which confused me bigtime is the syntax I've been using so
far without an issue (barring the q.op part).


lst name=appends
  str name=fqSource:TestHelp | Source:downloads |
-AccessMode:internal | -workflowparentid:[* TO *]/str
/lst

This has been working as expected and applies the filter correctly. Just
curious, if its an invalid syntax, how's Solr handling this ?


Honestly, I can't really say what's going on here.  After I got this, I 
tried some example queries like that and they do seem to be parsed 
right.  You could try adding turning on debugQuery for the query that 
doesn't work and see if you can see what the problem is.  I had never 
seen a query syntax with | in it before.  The other syntax is a little 
more explicit, though.


Thanks,
Shawn



Re: Weird issue with q.op=AND

2014-02-12 Thread shamik
Thanks, I'll take a look at the debug data.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Weird-issue-with-q-op-AND-tp4117013p4117047.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Weird issue with q.op=AND

2014-02-12 Thread Jack Krupansky
Did you mean to use || for the OR operator? A single | is not treated as 
an operator - it will be treated as a term and sent through normal term 
analysis.


-- Jack Krupansky

-Original Message- 
From: Shamik Bandopadhyay

Sent: Wednesday, February 12, 2014 5:32 PM
To: solr-user@lucene.apache.org
Subject: Weird issue with q.op=AND

Hi,

 I'm facing a weird problem while using q.op=AND condition. Looks like it
gets into some conflict if I use multiple appends condition in
conjunction. It works as long as I've one filtering condition in appends.

lst name=appends
  str name=fqSource:TestHelp/str
/lst

Now, the moment I add an additional parameter, search stops returning any
result.

lst name=appends
  str name=fqSource:TestHelp | Source:TestHelp2/str
/lst

If I remove q.op=AND from request handler, I get results back. Data is
present for both the Source I'm using, so it's not a filtering issue. Even
a blank query fails to return data.

Here's my request handler.

requestHandler name=/testhandler class=solr.SearchHandler
lst name=defaults
str name=echoParamsexplicit/str
float name=tie0.01/float
str name=wtvelocity/str
str name=v.templatebrowse/str
str name=v.contentTypetext/html;charset=UTF-8/str
str name=v.layoutlayout/str
str name=v.channeltesthandler/str
str name=defTypeedismax/str
str name=q.opAND/str
str name=q.alt*:*/str
str name=rows15/str
str name=flid,url,Source2,text/str
str name=qftext^1.5 title^2/str
str name=bqSource:TestHelp^3 Source:TestHelp2^0.85/str
str name=bfrecip(ms(NOW/DAY,PublishDate),3.16e-11,1,1)^2.0/str
str name=dftext/str

!-- facets --
str name=faceton/str
str name=facet.mincount1/str
str name=facet.limit100/str
str name=facet.fieldlanguage/str
str name=facet.fieldSource/str
!-- Highlighting defaults --
str name=hltrue/str
str name=hl.fltext title/str
str name=f.text.hl.fragsize250/str
str name=f.text.hl.alternateFieldShortDesc/str

!-- Spell check settings --
str name=spellchecktrue/str
str name=spellcheck.dictionarydefault/str
str name=spellcheck.collatetrue/str
str name=spellcheck.onlyMorePopularfalse/str
str name=spellcheck.extendedResultsfalse/str
str name=spellcheck.count1/str

  !-- Shard Tolerant --
   str name=shards.toleranttrue/str
/lst
lst name=appends
str name=fqSource:TestHelp | Source2:TestHelp2/str
/lst
arr name=last-components
strspellcheck/str
/arr
/requestHandler

Not sure what's going wrong. I'm using a SolrCloud environment with 2
shards having a replica each.

Any pointers will be appreciated.

Thanks,
Shamik