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 Erol Akarsu <ea...@gmail.com> on 2013/03/06 19:06:43 UTC

Faceted search on SOLR

Hello,

I am trying to design faceted search with SOLR.

When I define

<str name="facet.field">CPU_Type</str>

I am getting results with http://localhost:8080/solr/browse

CPU Type

    core (415)
    intel (368)
    i5 (176)
    i3 (104)
    i7 (74)
    series (73)
    pentium (60)
    amd (55)
    2 (44)
    duo (42)
    fx (39)
    apu (24)
    dual (17)
    atom (16)

But I would like to get this type of faceting:

CPU Type
    Intel Core i3 (109)
    Intel Core i5 (184)
    Intel Core i7 (82)
    AMD FX-Series (36)
    A4-Series APU (5)
    A6-Series APU (7)

How Can I get second result?

I appreciate you help

Erol Akarsu

Re: Faceted search on SOLR

Posted by eakarsu <ea...@gmail.com>.
Thanks for help, Alexandre.

It worked as you described.

I have other question. Suppose I have product catalogue that has many sub
categories, each one has different group of fields.
When a user search the catalogue, we should show corresponding facet fields
on left based on result set. That means we should be dynamically pick
appropriate facets  to show based on result products from search. 
Can we do it with SOLR?  Or SOLR can show only static facets configured? It
is better to show only related facets I guess.
Also, can we filter out facets that has ,say less than 10 results?

I appreciate your answer

Erol Akarsu




--
View this message in context: http://lucene.472066.n3.nabble.com/Faceted-search-on-SOLR-tp4045297p4045563.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Faceted search on SOLR

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Facets work on the tokenized content of the field. You must be using
text_en or similar type. Switch the facet field to use String. If you are
using eDisMax and want to be able to search it for substrings (e.g. if
somebody searches for Intel), use copyField to create two fields, one for
searching, one for faceting.

Regards,
   Alex.

Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all at
once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD book)


On Wed, Mar 6, 2013 at 1:06 PM, Erol Akarsu <ea...@gmail.com> wrote:

> Hello,
>
> I am trying to design faceted search with SOLR.
>
> When I define
>
> <str name="facet.field">CPU_Type</str>
>
> I am getting results with http://localhost:8080/solr/browse
>
> CPU Type
>
>     core (415)
>     intel (368)
>     i5 (176)
>     i3 (104)
>     i7 (74)
>     series (73)
>     pentium (60)
>     amd (55)
>     2 (44)
>     duo (42)
>     fx (39)
>     apu (24)
>     dual (17)
>     atom (16)
>
> But I would like to get this type of faceting:
>
> CPU Type
>     Intel Core i3 (109)
>     Intel Core i5 (184)
>     Intel Core i7 (82)
>     AMD FX-Series (36)
>     A4-Series APU (5)
>     A6-Series APU (7)
>
> How Can I get second result?
>
> I appreciate you help
>
> Erol Akarsu
>