Faceted search glitch???

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Faceted search glitch???

Peter McPeterson
On Solr, I'm indexing a facet field which contains different values on each
record (of course) but it doesn't seem to be working the way I had expected.
For instance:

When looking for:
http://localhost:8983/solr/select/?q=sales&facet=true&facet.field=education_facet

it returns the facet:
'education_facet'=>{
         'Bachelor'=>20,
         'Associate'=>35,
         'Doctorate'=>1,
         'High School'=>150,
         'Law Degree'=>0,
         'Master'=>0}

but when I modify my query to look for High School:
http://localhost:8983/solr/select/?q=sales+AND+education_facet:High+School&facet=true&facet.field=education_facet

it returns nothing. But when I use single-word fields such as Bachelor or
Associate it works fine.

Any idea?

Thanks a lot

_________________________________________________________________
Check out all that glitters with the MSN Entertainment Guide to the Academy
Awards®   http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline2

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Yonik Seeley-2
On 2/9/07, Peter McPeterson <[hidden email]> wrote:

> On Solr, I'm indexing a facet field which contains different values on each
> record (of course) but it doesn't seem to be working the way I had expected.
> For instance:
>
> When looking for:
> http://localhost:8983/solr/select/?q=sales&facet=true&facet.field=education_facet
>
> it returns the facet:
> 'education_facet'=>{
>          'Bachelor'=>20,
>          'Associate'=>35,
>          'Doctorate'=>1,
>          'High School'=>150,
>          'Law Degree'=>0,
>          'Master'=>0}
>
> but when I modify my query to look for High School:
> http://localhost:8983/solr/select/?q=sales+AND+education_facet:High+School&facet=true&facet.field=education_facet
>
> it returns nothing. But when I use single-word fields such as Bachelor or
> Associate it works fine.

education_facet:High+School
Is parsed by the lucene query parser as
  education_facet:High OR default_field:School
Surround it by quotes to make it a single term.

Also, for efficiency, you should put the filter in an fq param:
http://localhost:8983/solr/select/?q=sales&fq=education_facet:"High
School"&facet=true&facet.field=education_facet

-Yonik
Reply | Threaded
Open this post in threaded view
|

RE: Faceted search glitch???

Gunther, Andrew
In reply to this post by Peter McPeterson
Try surrounding you mutli-word query in quotes: education_facet:"High
School".  Also do you want to use the filter query param instead
fq=education_facet:"High School"

-Andrew

-----Original Message-----
From: Peter McPeterson [mailto:[hidden email]]
Sent: Friday, February 09, 2007 4:22 PM
To: [hidden email]
Subject: Faceted search glitch???

On Solr, I'm indexing a facet field which contains different values on
each
record (of course) but it doesn't seem to be working the way I had
expected.
For instance:

When looking for:
http://localhost:8983/solr/select/?q=sales&facet=true&facet.field=educat
ion_facet

it returns the facet:
'education_facet'=>{
         'Bachelor'=>20,
         'Associate'=>35,
         'Doctorate'=>1,
         'High School'=>150,
         'Law Degree'=>0,
         'Master'=>0}

but when I modify my query to look for High School:
http://localhost:8983/solr/select/?q=sales+AND+education_facet:High+Scho
ol&facet=true&facet.field=education_facet

it returns nothing. But when I use single-word fields such as Bachelor
or
Associate it works fine.

Any idea?

Thanks a lot

_________________________________________________________________
Check out all that glitters with the MSN Entertainment Guide to the
Academy
Awards(r)
http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline2

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Peter McPeterson
In reply to this post by Yonik Seeley-2
Awesome, thanks that works.


>From: "Yonik Seeley" <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: Faceted search glitch???
>Date: Fri, 9 Feb 2007 16:28:05 -0500
>
>On 2/9/07, Peter McPeterson <[hidden email]> wrote:
>>On Solr, I'm indexing a facet field which contains different values on
>>each
>>record (of course) but it doesn't seem to be working the way I had
>>expected.
>>For instance:
>>
>>When looking for:
>>http://localhost:8983/solr/select/?q=sales&facet=true&facet.field=education_facet
>>
>>it returns the facet:
>>'education_facet'=>{
>>          'Bachelor'=>20,
>>          'Associate'=>35,
>>          'Doctorate'=>1,
>>          'High School'=>150,
>>          'Law Degree'=>0,
>>          'Master'=>0}
>>
>>but when I modify my query to look for High School:
>>http://localhost:8983/solr/select/?q=sales+AND+education_facet:High+School&facet=true&facet.field=education_facet
>>
>>it returns nothing. But when I use single-word fields such as Bachelor or
>>Associate it works fine.
>
>education_facet:High+School
>Is parsed by the lucene query parser as
>  education_facet:High OR default_field:School
>Surround it by quotes to make it a single term.
>
>Also, for efficiency, you should put the filter in an fq param:
>http://localhost:8983/solr/select/?q=sales&fq=education_facet:"High
>School"&facet=true&facet.field=education_facet
>
>-Yonik

_________________________________________________________________
Turn searches into helpful donations. Make your search count.
http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donation&FORM=WLMTAG

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Yonik Seeley-2
In reply to this post by Gunther, Andrew
On 2/9/07, Gunther, Andrew <[hidden email]> wrote:
> Try surrounding you mutli-word query in quotes: education_facet:"High
> School".  Also do you want to use the filter query param instead
> fq=education_facet:"High School"

Hopefully having the client escape simple term filters won't be
necessary in the future.
We've discussed a prefix to annotate queries to support other query syntaxes.
The simplest form would be a term query with no escaping whatsoever:

Something like:
fq=<!term f='education_facet'>High School

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Erik Hatcher

On Feb 9, 2007, at 4:45 PM, Yonik Seeley wrote:

> On 2/9/07, Gunther, Andrew <[hidden email]> wrote:
>> Try surrounding you mutli-word query in quotes: education_facet:"High
>> School".  Also do you want to use the filter query param instead
>> fq=education_facet:"High School"
>
> Hopefully having the client escape simple term filters won't be
> necessary in the future.
> We've discussed a prefix to annotate queries to support other query  
> syntaxes.
> The simplest form would be a term query with no escaping whatsoever:
>
> Something like:
> fq=<!term f='education_facet'>High School

This is *definitely* needed.  Having an fq parameter analyzed won't  
work in many cases.

        Erik


Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Chris Hostetter-3
In reply to this post by Yonik Seeley-2

: The simplest form would be a term query with no escaping whatsoever:
:
: Something like:
: fq=<!term f='education_facet'>High School

I know yonik isn't a big fan of query param proliferation, and there's
definitely going to be a need for some kind of markup in the future to
denote which query syntax to use for different params, but if facetting
and filtering is driving a strong need for a simple way to filter on a
facet constraint term then perhaps a special param would make that easier
... in hte same way that "fq" is a filter query, perhaps "ft" can be a
filter term: no analysys, just split on the first ":" found, and make a
Term query using the LHS as the field name and the RHS as the term...

  URL:  ft=education_facet%3AHigh+School
  CONF: <str name="ft">education_facet:High School</str>

        ...instead of...

  URL:  fq=education_facet%3A%22High+School%22
  CONF: <str name="fq">education_facet:"High School"</str>
        ...or...
  URL:  fq=%3C%21term+f%3D%27education_facet%27%3EHigh+School
  CONF: <str name="fq">&lt;!term f='education_facet'&gt;High School</str>


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Yonik Seeley-2
On 2/9/07, Chris Hostetter <[hidden email]> wrote:

> : The simplest form would be a term query with no escaping whatsoever:
> :
> : Something like:
> : fq=<!term f='education_facet'>High School
>
> I know yonik isn't a big fan of query param proliferation, and there's
> definitely going to be a need for some kind of markup in the future to
> denote which query syntax to use for different params, but if facetting
> and filtering is driving a strong need for a simple way to filter on a
> facet constraint term then perhaps a special param would make that easier
> ... in hte same way that "fq" is a filter query, perhaps "ft" can be a
> filter term: no analysys, just split on the first ":" found, and make a
> Term query using the LHS as the field name and the RHS as the term...

Yes, I don't like the proliferation, but...
ft=education_facet:High School
  is both simpler and 11 characters shorter than
fq=<!term f='education_facet'>High School

And I think term queries for filters are (or will be) very common in
Solr.  I think facet-related navigation isn't going to go away....  so
I guess I'm not opposed to ft in this case.
Anyone else have thoughts/alternatives?

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Erik Hatcher
ft and fq work for me!

        Erik


On Feb 9, 2007, at 5:35 PM, Yonik Seeley wrote:

> On 2/9/07, Chris Hostetter <[hidden email]> wrote:
>> : The simplest form would be a term query with no escaping  
>> whatsoever:
>> :
>> : Something like:
>> : fq=<!term f='education_facet'>High School
>>
>> I know yonik isn't a big fan of query param proliferation, and  
>> there's
>> definitely going to be a need for some kind of markup in the  
>> future to
>> denote which query syntax to use for different params, but if  
>> facetting
>> and filtering is driving a strong need for a simple way to filter  
>> on a
>> facet constraint term then perhaps a special param would make that  
>> easier
>> ... in hte same way that "fq" is a filter query, perhaps "ft" can  
>> be a
>> filter term: no analysys, just split on the first ":" found, and  
>> make a
>> Term query using the LHS as the field name and the RHS as the term...
>
> Yes, I don't like the proliferation, but...
> ft=education_facet:High School
>  is both simpler and 11 characters shorter than
> fq=<!term f='education_facet'>High School
>
> And I think term queries for filters are (or will be) very common in
> Solr.  I think facet-related navigation isn't going to go away....  so
> I guess I'm not opposed to ft in this case.
> Anyone else have thoughts/alternatives?
>
> -Yonik

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Mike Klaas
Might I suggest:

filter.query
filter.term
filter.<future expansion>

-Mike

On 2/9/07, Erik Hatcher <[hidden email]> wrote:

> ft and fq work for me!
>
>         Erik
>
>
> On Feb 9, 2007, at 5:35 PM, Yonik Seeley wrote:
>
> > On 2/9/07, Chris Hostetter <[hidden email]> wrote:
> >> : The simplest form would be a term query with no escaping
> >> whatsoever:
> >> :
> >> : Something like:
> >> : fq=<!term f='education_facet'>High School
> >>
> >> I know yonik isn't a big fan of query param proliferation, and
> >> there's
> >> definitely going to be a need for some kind of markup in the
> >> future to
> >> denote which query syntax to use for different params, but if
> >> facetting
> >> and filtering is driving a strong need for a simple way to filter
> >> on a
> >> facet constraint term then perhaps a special param would make that
> >> easier
> >> ... in hte same way that "fq" is a filter query, perhaps "ft" can
> >> be a
> >> filter term: no analysys, just split on the first ":" found, and
> >> make a
> >> Term query using the LHS as the field name and the RHS as the term...
> >
> > Yes, I don't like the proliferation, but...
> > ft=education_facet:High School
> >  is both simpler and 11 characters shorter than
> > fq=<!term f='education_facet'>High School
> >
> > And I think term queries for filters are (or will be) very common in
> > Solr.  I think facet-related navigation isn't going to go away....  so
> > I guess I'm not opposed to ft in this case.
> > Anyone else have thoughts/alternatives?
> >
> > -Yonik
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Chris Hostetter-3

: filter.query
: filter.term
: filter.<future expansion>

there's a whole lot of Unicode letters availble thta could fill in the f_
blank, how much more expansion do we really need? :)

I suppose filter.term is a wise choice, and adding filter.query as an
alias makes sense too ... i'm just a big fan of short param names.

(if nothing else, it encourages us not to add too many of them)



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Erik Hatcher
In reply to this post by Mike Klaas

On Feb 9, 2007, at 9:16 PM, Mike Klaas wrote:
> Might I suggest:
>
> filter.query
> filter.term
> filter.<future expansion>

I like it.  While Hoss has a point, though descriptive names do make  
a lot of sense too.  It has been a bit confusing to explain  
facet.query and fq as two different things.  However, is there any  
concern, at all, about the added overhead in passing larger requests  
around?
 
Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Mike Klaas
On 2/9/07, Erik Hatcher <[hidden email]> wrote:

>
> On Feb 9, 2007, at 9:16 PM, Mike Klaas wrote:
> > Might I suggest:
> >
> > filter.query
> > filter.term
> > filter.<future expansion>
>
> I like it.  While Hoss has a point, though descriptive names do make
> a lot of sense too.  It has been a bit confusing to explain
> facet.query and fq as two different things.

I like self-documenting parameter names, but if there is concern about
verbosity, how 'bout:

fq
fq.term

(also, filter.q could be used in the longer version).

As for future expansion, some possibilities are: filter.op/filter.q.op
(set operator of filter query parser, which is currently OR regardless
of the solrconfig setting),  filter.range, and filter.q.noncached
(something I would definitely use if it existed).

> However, is there any
> concern, at all, about the added overhead in passing larger requests
> around?

I would guess that the difference would be impossible to measure, but
I don't really know.

-Mike
Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Chris Hostetter-3
: > > filter.query
: > > filter.term
: > > filter.<future expansion>

: I like self-documenting parameter names, but if there is concern about
: verbosity, how 'bout:
:
: fq
: fq.term

no it's cool ... filter.query and filter.term are definitely better.

: As for future expansion, some possibilities are: filter.op/filter.q.op
: (set operator of filter query parser, which is currently OR regardless

I'm not sure why/how thta would ever make sense... you'd be much better
off using seperate filters so they can cache independently - not to
mention the reason q.op was added was for dealing with user entered query
strings, but are filter queries ever entered manually by a user?

: of the solrconfig setting),  filter.range, and filter.q.noncached
: (something I would definitely use if it existed).

filter range could just be done with a filter.query/fq right?  a
non-cached fq might make sense though.



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Mike Klaas
On 2/10/07, Chris Hostetter <[hidden email]> wrote:

> : As for future expansion, some possibilities are: filter.op/filter.q.op
> : (set operator of filter query parser, which is currently OR regardless
>
> I'm not sure why/how thta would ever make sense... you'd be much better
> off using seperate filters so they can cache independently - not to
> mention the reason q.op was added was for dealing with user entered query
> strings, but are filter queries ever entered manually by a user?

See below.

> : of the solrconfig setting),  filter.range, and filter.q.noncached
> : (something I would definitely use if it existed).
>
> filter range could just be done with a filter.query/fq right?  a

It sure could, but I was just trying to stretch my imagination as far
as possible.  filter.term also seems to me like only a marginal
improvement over lucene syntax.

-Mike
Reply | Threaded
Open this post in threaded view
|

Re: Faceted search glitch???

Chris Hostetter-3

: It sure could, but I was just trying to stretch my imagination as far
: as possible.  filter.term also seems to me like only a marginal
: improvement over lucene syntax.

the only reason i suggested filter.term at all was because it eliminates
hte need to worry baout quoting/escaping when dealing with simple term
based facets ... right now you have to put the facet term in quotes
(inlcuding posisble quote escaping) ... if we add a filter.term param you
can write client code that is blindly ignorant of what facet constraint is
being filtered on.


-Hoss