lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doddamani, Prakash" <prakash.doddam...@corp.aol.com>
Subject RE: how to achieve filters
Date Tue, 18 May 2010 15:13:51 GMT
Thanks much Ahmet,

Yep content is string, and bitrate is int.

I am digging more now Can we combine both the scenarios.

q=rock&fq={!field f=content}mp3 
q=rock&fq:bitrate:[* TO 128]

Say if I want only mp3 from 0 to 128

Regards
Prakash

-----Original Message-----
From: Ahmet Arslan [mailto:iorixxx@yahoo.com] 
Sent: Tuesday, May 18, 2010 8:24 PM
To: solr-user@lucene.apache.org
Subject: Re: how to achieve filters

> I am using "dismax" query to fetch docs from solr where I have set 
> some boost to the each fields,
> 
>  
> 
> If I search for query "Rock" I get following docs with some boost 
> value which I have specified,
> 
>  
> 
> <doc>
>   <float name="score">19.494072</float>
>   <int name="bitrate">120</int>
>   <str name="content">mp3</str>
>   <str name="genre">Rock</str>
>   <str name="id">1</str>
>   <str name="name">st name 1</str>
> </doc>
> <doc>
>   <float name="score">19.494052</float>
>   <int name="bitrate">248</int>
>   <str name="content">aac+</str>
>   <str name="genre">Rock</str>
>   <str name="id">2</str>
>   <str name="name">st name 2</str>
> </doc>
> <doc>
>   <float name="score">19.494042</float>
>   <int name="bitrate">127</int>
>   <str name="content">aac+</str>
>   <str name="genre">Rock</str>
>   <str name="id">3</str>
>   <str name="name">st name 3</str>
> </doc>
> <doc>
>   <float name="score">19.494032</float>
>   <int name="bitrate">256</int>
>   <str name="content">mp3</str>
>   <str name="genre">Rock</str>
>   <str name="id">4</str>
>   <str name="name">st name 5</str>
> </doc>
>  
> 
> I am looking for something below What is the best way to achieve them 
> ?

With filter queries. fq=

> 1. Query=rock where content= mp3 where it should return only first and 
> last docs where content=mp3

Assuming that content is string typed. q=rock&fq={!field f=content}mp3 

> 2. Query=rock where bitrate<128 where it should return only first and 
> third docs where bitrate<128

&q=rock&fq:bitrate:[* TO 128] for this bitrate field must be tint type.



      

Mime
View raw message