Custom faceting question

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

Custom faceting question

Blargy
I believe I'll need to write some custom code to accomplish what I want (efficiently that is) but I'm unsure of what would be the best route to take. Will this require a custom request handler? Search component?

Ok the easiest way to explain is to show you what I want. http://shop.ebay.com/?_from=R40&_trksid=p3907.m570.l1313&_nkw=fashion&_sacat=See-All-Categories.

We have a similar category structure whereas we have top level-categories and then sub-categories. I want to be able to perform a search and then only return the top 3 top-level categories with their sub-categories also faceted. The problem is I don't know what those top 3 top-level categories are until after I search.

The dumb easy way: Facet on all top-level categories and sub-categories. This results in faceting on over 600 categories... probably not the best route.

Second way. Have the client send multiple requests on the backend. First to determine the top 3 categories, then another for all the subcategories. This involves more client side coding and I would prefer not to perform 2x the requests. If at all possible I would like to do this on the Solr side.

Just to mention, sending multiple requests via ajax won't work because we need the content on the page at render time.

Any suggestions, pointers? Thanks



Reply | Threaded
Open this post in threaded view
|

solr-lucene AND vs "+"

Jonathan Rochkind
Using solr-lucene query parser, is there a difference between using
"AND" and using "+" in querries like this:

1)   q= some_field:( one AND two AND "some phrase")

2)   q= some_field:(+one +two +"some phrase")

Are those always exactly identical in all respects, or are there any
differences in terms of result sets, relevancy ranking, or potentially
performance?

Thanks for any advice,

Jonathan
Reply | Threaded
Open this post in threaded view
|

Re: solr-lucene AND vs "+"

iorixxx
> Using solr-lucene query parser, is
> there a difference between using "AND" and using "+" in
> querries like this:
>
> 1)   q= some_field:( one AND two AND "some
> phrase")
>
> 2)   q= some_field:(+one +two +"some
> phrase")
>
> Are those always exactly identical in all respects, or are
> there any differences in terms of result sets, relevancy
> ranking, or potentially performance?

Your two examples are identical. You can verify this by adding &debugQuery=on to your search URL.
AND OR NOT operators parsed/converted into their + - forms.

About unitary operators versus AND OR NOT :
http://wiki.apache.org/lucene-java/BooleanQuerySyntax



Reply | Threaded
Open this post in threaded view
|

Re: Custom faceting question

Chris Hostetter-3
In reply to this post by Blargy

: I believe I'll need to write some custom code to accomplish what I want
: (efficiently that is) but I'm unsure of what would be the best route to
: take. Will this require a custom request handler? Search component?

You'll need a customized version of the FacetComponent if you want to do
this all on the server side.

: We have a similar category structure whereas we have top level-categories
: and then sub-categories. I want to be able to perform a search and then only
: return the top 3 top-level categories with their sub-categories also
: faceted. The problem is I don't know what those top 3 top-level categories
: are until after I search.

the main complexity with a situation like this is how you model it.  
regardless of wether you do it server side or client side the straight
forward appraoch is to do basic faceting on a "top level" category field,
and then given the top three responses do secondary faceting o na field
that contains the full category "breadcrumb" -- either using something
like facet.prefix or by walking some other in memory data structure
represending your category graph that lets you access the children of a
particular category (depends wether you need complex rules to identify
what documents are in a category)

: Second way. Have the client send multiple requests on the backend. First to
: determine the top 3 categories, then another for all the subcategories. This
: involves more client side coding and I would prefer not to perform 2x the
: requests. If at all possible I would like to do this on the Solr side.

...you've already got the conceptual model of how to do it, all you need
now is to implement it as a Component that does the secondary-faceting in
the same requests (which should definitley be more efficient since you can
reuse the DocSets) instead of issuing secondary requets from your client



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Custom faceting question

Blargy
: ...you've already got the conceptual model of how to do it, all you need
: now is to implement it as a Component that does the secondary-faceting in
: the same requests (which should definitley be more efficient since you can
: reuse the DocSets) instead of issuing secondary requets from your client

Couldn't I just create a custom search handler to do this so it all the logic resides on the server side? I'm guessing I would need to subclass SearchHandler and override handleRequestBody.
Reply | Threaded
Open this post in threaded view
|

Re: Custom faceting question

Chris Hostetter-3

: : ...you've already got the conceptual model of how to do it, all you need
: : now is to implement it as a Component that does the secondary-faceting in
: : the same requests (which should definitley be more efficient since you can
: : reuse the DocSets) instead of issuing secondary requets from your client
:
: Couldn't I just create a custom search handler to do this so it all the
: logic resides on the server side? I'm guessing I would need to subclass
: SearchHandler and override handleRequestBody.

I think you're missunderstanding me -- i'm agreeing with you that you can
do it on the server side, and that it will make sense to do it on the
server side -- i'm saying that instead of  impelementing a SearchHandler,
you should just implement a SearchComponent that you would use in place of
(or in addition to) FacetComponent ...

  http://wiki.apache.org/solr/SearchComponent


-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Custom faceting question

Blargy
Got it. Thanks!