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 John Ni <jo...@yahoo.com> on 2007/07/22 08:19:56 UTC

Filter Search!

Hi all, 
    I have a question regarding filter Search with the subset: Let say, I have the following form
   
  Search article [xyz]
  Subject: {x] Math [X]English [ ] Science
  Grade: [ ] freshman [x] junior [x]senior
   
  so the query syntax would be q=xyz&fq=Subject:Math+English&fq=Grade:junior+senior
   
  Basically, I'm seaching for the article containg "xyz" in either in Math or English subject for either junior or senior grade.  Currenlty, I'm trying EmbeddedSolr http://wiki.apache.org/solr/EmbeddedSolr , but I having a hard time implementing above filter search.  I was just wonder anybody had implemented similar case using EmbeddedSolr or any other method.  If anybody has any idea/suggestion please let this newbie know.  
  Cheers,
  Jonny 

       
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 

Re: Filter Search!

Posted by Mike Klaas <mi...@gmail.com>.
On 23-Jul-07, at 7:46 AM, John Ni wrote:

> Hi all,
>      The root of this posting regarding "Filter Search" might sound  
> specific to the embedded solr mode but if anyone has experience  
> handle the similar situation with different implementations,  
> multiple subtype filter search( I might not be using the right  
> words to describe it but please look at the root of this thread to  
> understand the case) please suggest me how to handle those kind of  
> situation.  So far I have able to use the javascript to create the  
> query syntax before sending it to my servlet.  My javascript  
> creates, for example, the following string:
>
>   ?q=xyz&fq=subject:Math+English$fq=grade:junior+senior
>   then send this string to servlet to handle the query.  But just  
> wondering, is there the other way to handle the same issue.   
> Looking forward to hearing any comments/suggestion.

John,

The problem is that your query/filter syntax is incorrect.

subject:Math English

does _not_ search for subject=Math OR subject=English.  It searches  
for subject=Math OR 'English' in the default search field.

You need to use
subject:Math subject:English
or
subject:(Math English)

regards,
-Mike

> Mike Klaas <mi...@gmail.com> wrote:
>
> On 21-Jul-07, at 11:19 PM, John Ni wrote:
>
>> Hi all,
>> I have a question regarding filter Search with the subset: Let
>> say, I have the following form
>>
>> Search article [xyz]
>> Subject: {x] Math [X]English [ ] Science
>> Grade: [ ] freshman [x] junior [x]senior
>>
>> so the query syntax would be q=xyz&fq=Subject:Math
>> +English&fq=Grade:junior+senior
>>
>> Basically, I'm seaching for the article containg "xyz" in either
>> in Math or English subject for either junior or senior grade.
>> Currenlty, I'm trying EmbeddedSolr http://wiki.apache.org/solr/
>> EmbeddedSolr , but I having a hard time implementing above filter
>> search. I was just wonder anybody had implemented similar case
>> using EmbeddedSolr or any other method. If anybody has any idea/
>> suggestion please let this newbie know.
>
> I'm not sure what is the canonical way of passing parameters in
> embedded mode, but the main problem is likely the values of your
> parameters. you probably want:
>
> Subject:(Math English)
> Grade:(junior senior)
>
> -Mike
>
>
>
> ---------------------------------
> Get the Yahoo! toolbar and be alerted to new email wherever you're  
> surfing.


Re: Filter Search!

Posted by John Ni <jo...@yahoo.com>.
Hi all,
     The root of this posting regarding "Filter Search" might sound specific to the embedded solr mode but if anyone has experience handle the similar situation with different implementations, multiple subtype filter search( I might not be using the right words to describe it but please look at the root of this thread to understand the case) please suggest me how to handle those kind of situation.  So far I have able to use the javascript to create the query syntax before sending it to my servlet.  My javascript creates, for example, the following string:
   
  ?q=xyz&fq=subject:Math+English$fq=grade:junior+senior 
  then send this string to servlet to handle the query.  But just wondering, is there the other way to handle the same issue.  Looking forward to hearing any comments/suggestion.
  Regards,
  Jonny

Mike Klaas <mi...@gmail.com> wrote:
  
On 21-Jul-07, at 11:19 PM, John Ni wrote:

> Hi all,
> I have a question regarding filter Search with the subset: Let 
> say, I have the following form
>
> Search article [xyz]
> Subject: {x] Math [X]English [ ] Science
> Grade: [ ] freshman [x] junior [x]senior
>
> so the query syntax would be q=xyz&fq=Subject:Math 
> +English&fq=Grade:junior+senior
>
> Basically, I'm seaching for the article containg "xyz" in either 
> in Math or English subject for either junior or senior grade. 
> Currenlty, I'm trying EmbeddedSolr http://wiki.apache.org/solr/ 
> EmbeddedSolr , but I having a hard time implementing above filter 
> search. I was just wonder anybody had implemented similar case 
> using EmbeddedSolr or any other method. If anybody has any idea/ 
> suggestion please let this newbie know.

I'm not sure what is the canonical way of passing parameters in 
embedded mode, but the main problem is likely the values of your 
parameters. you probably want:

Subject:(Math English)
Grade:(junior senior)

-Mike


       
---------------------------------
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. 

Re: Filter Search!

Posted by Mike Klaas <mi...@gmail.com>.
On 21-Jul-07, at 11:19 PM, John Ni wrote:

> Hi all,
>     I have a question regarding filter Search with the subset: Let  
> say, I have the following form
>
>   Search article [xyz]
>   Subject: {x] Math [X]English [ ] Science
>   Grade: [ ] freshman [x] junior [x]senior
>
>   so the query syntax would be q=xyz&fq=Subject:Math 
> +English&fq=Grade:junior+senior
>
>   Basically, I'm seaching for the article containg "xyz" in either  
> in Math or English subject for either junior or senior grade.   
> Currenlty, I'm trying EmbeddedSolr http://wiki.apache.org/solr/ 
> EmbeddedSolr , but I having a hard time implementing above filter  
> search.  I was just wonder anybody had implemented similar case  
> using EmbeddedSolr or any other method.  If anybody has any idea/ 
> suggestion please let this newbie know.

I'm not sure what is the canonical way of passing parameters in  
embedded mode, but the main problem is likely the values of your  
parameters.  you probably want:

Subject:(Math English)
Grade:(junior senior)

-Mike