Re: filtering search using regex

2008-04-12 Thread Mathieu Lecarme

hi,

I have a question ... I need to be able to filter a search using a  
regex. I
cannot used facet as the filtering is pretty complex (but easy to  
perform

using a regex).
For instance I have stored in the field ID the value 12G and I want to
basically filter out all the results that are > 12 with G so for  
instance

14G will match but 8G and 14B would not. Using a regex this is simply
"[1-9]+[3-9]G" ..
i am wondering what the right approach is to tackle such a  
situation ..


thanks.
regex match is only useful when you first select a prefix, wich is a  
basic lucene feature : put the pointer just up to the first term  
begining with "toto".

Your query don't have any prefix.
What happen if you split your data in two field "12"  and "G", "14"  
and "B", or, better, if it's number, "12G" can be indexed as "1200"?


M.


Re: Facet Query

2008-04-12 Thread Shalin Shekhar Mangar
Facet fields and facet queries do not depend on each other. Both of them
depend only on the query and filter queries applied.

For example, lets say you're searching for cars with a full text query
"hybrid sedan" and the UI should show counts of each manufacturer of the car
e.g. Honda - 20, Chevrolet - 10 etc. You also want to show how many cars in
the result are priced between 10,000 to 20,000. In this case, you would
execute a solr query like:
q="hybrid
sedan"&facet=true&facet.field=manufacturer&facet.query:price:[1 TO
2]

Hope that helps.

On 4/12/08, Norskog, Lance <[EMAIL PROTECTED]> wrote:
>
> Ok.
>
> I have a query that returns a set A. Doing a facet on field F gives me:
> All values of F in the index given as count(*)
> And these values can include 0.
>
> I add a facet query that returns B. The facet operation now returns
> count(*) on only the values of F that are found in query B.
> Query B is only used as a set, none of the counts in query B are used.
>
> Is this it?
>
> Thanks,
>
>
> Lance
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yonik
> Seeley
> Sent: Friday, April 11, 2008 1:36 PM
> To: solr-user@lucene.apache.org
> Cc: Norskog, Lance
> Subject: Re: Facet Query
>
> On Fri, Apr 11, 2008 at 4:32 PM, Lance Norskog <[EMAIL PROTECTED]>
> wrote:
> > What do facet queries do that is different from the regular query?
> > What is  a use case where I would use a facet.query in addition to the
> regular query?
>
> It returns the number of documents that match the query AND the
> facet.query.
>
> -Yonik
>



-- 
Regards,
Shalin Shekhar Mangar.


Re: filtering search using regex

2008-04-12 Thread Abeba Tensai
hi mathieu,

i cannot split the data in a very meaningful way. My example is a bit
misleading.
basically, I can have the field FILTER indexed with 12K or 13B-14K and the
user might want results that have field FILTER > 13 and K, the first one
(12K) won't match because 12 < 13 but the second will (it has in the string
14K which is 14 > 12 and K). So I don't think that I can alter the way I
indexed data to be able to use facet .. it is just not possible ..
I am just trying to have people use regular free text search but then filter
the results using a regex ..

thanks.

On 4/12/08, Mathieu Lecarme <[EMAIL PROTECTED]> wrote:
>
>  hi,
> >
> > I have a question ... I need to be able to filter a search using a
> > regex. I
> > cannot used facet as the filtering is pretty complex (but easy to
> > perform
> > using a regex).
> > For instance I have stored in the field ID the value 12G and I want to
> > basically filter out all the results that are > 12 with G so for
> > instance
> > 14G will match but 8G and 14B would not. Using a regex this is simply
> > "[1-9]+[3-9]G" ..
> > i am wondering what the right approach is to tackle such a situation ..
> >
> > thanks.
> >
> regex match is only useful when you first select a prefix, wich is a basic
> lucene feature : put the pointer just up to the first term begining with
> "toto".
> Your query don't have any prefix.
> What happen if you split your data in two field "12"  and "G", "14" and
> "B", or, better, if it's number, "12G" can be indexed as "1200"?
>
> M.
>