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 Vardhan Dharnidharka <va...@hotmail.com> on 2013/06/05 21:36:38 UTC

Entire query is stopwords



Hi, 

I am using the standard edismax parser and my example query is as follows:

{!edismax qf='object_description ' rows=10 start=0 mm=-40% v='object'}

In this case, 'object' happens to be a stopword in the StopWordsFilter in my datatype 'object_description'. Now, since 'object' is not indexed at all, the query does not return any results. In an ideal case, I would want documents containing the term 'object' to be returned. 

What is the best practice to achieve this? Index stop-words and re-query with 'stopwords=false'. Or can this be done without re-querying?

Thanks, 
Vardhan 
 		 	   		  

Re: Entire query is stopwords

Posted by Jan Høydahl <ja...@cominvent.com>.
Remove the stopFilter from the "index" section of your fieldType, only keep it in the "query" section. This way your stopwords will always be indexed and edismax will be able to selectively remove stopwords from the query depending on whether all words are stopwords or not.

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

5. juni 2013 kl. 21:36 skrev Vardhan Dharnidharka <va...@hotmail.com>:

> 
> 
> 
> Hi, 
> 
> I am using the standard edismax parser and my example query is as follows:
> 
> {!edismax qf='object_description ' rows=10 start=0 mm=-40% v='object'}
> 
> In this case, 'object' happens to be a stopword in the StopWordsFilter in my datatype 'object_description'. Now, since 'object' is not indexed at all, the query does not return any results. In an ideal case, I would want documents containing the term 'object' to be returned. 
> 
> What is the best practice to achieve this? Index stop-words and re-query with 'stopwords=false'. Or can this be done without re-querying?
> 
> Thanks, 
> Vardhan 
> 		 	   		  


Re: Entire query is stopwords

Posted by Erick Erickson <er...@gmail.com>.
Your problem statement is fairly odd. You say
you've defined "object" as a stopword, but then
you want your query to return documents that
contain "object". By definition stopwords are
something that is considered irrelevant for searching
and are ignored.

So why not just take "object" out of your stopwords
file? Perhaps a separate stopwords file for that
particular field? Or just not use stopwords at all
for that field?

Best
Erick

On Wed, Jun 5, 2013 at 3:36 PM, Vardhan Dharnidharka
<va...@hotmail.com> wrote:
>
>
>
> Hi,
>
> I am using the standard edismax parser and my example query is as follows:
>
> {!edismax qf='object_description ' rows=10 start=0 mm=-40% v='object'}
>
> In this case, 'object' happens to be a stopword in the StopWordsFilter in my datatype 'object_description'. Now, since 'object' is not indexed at all, the query does not return any results. In an ideal case, I would want documents containing the term 'object' to be returned.
>
> What is the best practice to achieve this? Index stop-words and re-query with 'stopwords=false'. Or can this be done without re-querying?
>
> Thanks,
> Vardhan
>