Hi,

eDismax does its own query parsing before shipping the terms to Analysis (which 
is responsible for stopword removal). That's why these are not treated as 
stopwords. The quickest solution for you is probably to remove (or|OR|and|AND) 
before sending the query to Solr.

Also see SOLR-3086 for a suggestion to allow controlling whether boolean 
operators should be allowed or not - if not they would be passed as literal 
tokens to Analysis, in which case stopwords could be removed. You can vote for 
this issue if you like to see it implemented.

Another option could be to introduce a "global" stopwords list somewhere, would 
probably make sense at QP level, alternatively as a SearchComponent.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

On 9. mai 2012, at 11:49, jpascua wrote:

> Hi,
> 
> I could not prevent users from using and/or with their search so I just
> thought to add and/or in my stopwords.txt.  However solr, configured with
> edismax, lowercaseOperators=false, still treats "and" as an operator.  To
> illustrate below are the generated parsedQueries for the search term spoon
> (and|AND|or|OR) fork.  Notice that or/OR generated different queries while
> and/AND generated the same queries.  My assumption was, the generated query
> for the lowercase and should be the same as the lowercase or since both
> words were "stopped".
> 
> spoon and fork
> +(+DisjunctionMaxQuery((id:spoon^10.0 | cat:spoon | ((text:spoon
> text:spoon)^0.5) | manu:spoon^1.1 | sku:spoon^1.5 | name:spoon^1.4))
> +DisjunctionMaxQuery((id:fork^10.0 | cat:fork | text:fork^0.5 |
> manu:fork^1.1 | sku:fork^1.5 | name:fork^1.4)))
> 
> spoon AND fork
> +(+DisjunctionMaxQuery((id:spoon^10.0 | cat:spoon | ((text:spoon
> text:spoon)^0.5) | manu:spoon^1.1 | sku:spoon^1.5 | name:spoon^1.4))
> +DisjunctionMaxQuery((id:fork^10.0 | cat:fork | text:fork^0.5 |
> manu:fork^1.1 | sku:fork^1.5 | name:fork^1.4)))
> 
> spoon or fork
> +((DisjunctionMaxQuery((id:spoon^10.0 | cat:spoon | ((text:spoon
> text:spoon)^0.5) | manu:spoon^1.1 | sku:spoon^1.5 | name:spoon^1.4))
> DisjunctionMaxQuery((id:fork^10.0 | cat:fork | text:fork^0.5 | manu:fork^1.1
> | sku:fork^1.5 | name:fork^1.4)))~2)
> 
> spoon OR fork
> +(DisjunctionMaxQuery((id:spoon^10.0 | cat:spoon | ((text:spoon
> text:spoon)^0.5) | manu:spoon^1.1 | sku:spoon^1.5 | name:spoon^1.4))
> DisjunctionMaxQuery((id:fork^10.0 | cat:fork | text:fork^0.5 | manu:fork^1.1
> | sku:fork^1.5 | name:fork^1.4)))
> 
> my config is below:
>  <requestHandler name="/browse" class="solr.SearchHandler">
>     <lst name="defaults">
>       <str name="echoHandler">true</str> 
>       <str name="echoParams">all</str>
> 
> 
>       <str name="wt">velocity</str>
> 
>       <str name="v.template">browse</str>
>       <str name="v.layout">layout</str>
>       <str name="title">Solritas</str>
> 
>       <str name="df">text</str>
>       <str name="defType">edismax</str>
>       <str name="q.alt">*:*</str>
>       <str name="rows">10</str>
>       <str name="fl">*,score</str>
>       *<str name="lowercaseOperators">false</str>*
>       <str name="opUp">true</str>
>       <str name="notUp">true</str>
>       <str name="stopwords">true</str>
>       <str name="mlt.qf">
>         text^0.5 name^1.4 sku^1.5 id^10.0 manu^1.1 cat^1.0
>       </str>
>       <str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
>       <int name="mlt.count">3</int>
> 
>       <str name="qf">
>          text^0.5 name^1.4 sku^1.5 id^10.0 manu^1.1 cat^1.0
>       </str>
> 
>       <str name="facet">on</str>
>       <str name="facet.field">cat</str>
>       <str name="facet.field">manu_exact</str>
>       <str name="facet.query">ipod</str>
>       <str name="facet.query">GB</str>
>       <str name="facet.mincount">1</str>
>       <str name="facet.pivot">cat,inStock</str>
>       <str name="facet.range.other">after</str>
>       <str name="facet.range">price</str>
>       <int name="f.price.facet.range.start">0</int>
>       <int name="f.price.facet.range.end">600</int>
>       <int name="f.price.facet.range.gap">50</int>
>       <str name="facet.range">popularity</str>
>       <int name="f.popularity.facet.range.start">0</int>
>       <int name="f.popularity.facet.range.end">10</int>
>       <int name="f.popularity.facet.range.gap">3</int>
>       <str name="facet.range">manufacturedate_dt</str>
>       <str
> name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
>       <str name="f.manufacturedate_dt.facet.range.end">NOW</str>
>       <str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
>       <str name="f.manufacturedate_dt.facet.range.other">before</str>
>       <str name="f.manufacturedate_dt.facet.range.other">after</str>
> 
> 
> 
>       <str name="hl">on</str>
>       <str name="hl.fl">text features name</str>
>       <str name="f.name.hl.fragsize">0</str>
>       <str name="f.name.hl.alternateField">name</str>
>       <str name="f.features.hl.fragsize">0</str>
>       <str name="f.features.hl.alternateField">features</str>
>     </lst>
>     <arr name="last-components">
>       <str>spellcheck</str>
>     </arr>
> 
>  </requestHandler>
> 
> Any help to get around this issue would be much appreciated.
> 
> regards,
> Joel
> 
> 
> 
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Edismax-lowercaseOperators-false-does-not-ignore-lowercase-and-tp3973669.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to