Hi Rok,

If I understood the use case rightly, Grouping of the results are
possible in Solr http://wiki.apache.org/solr/FieldCollapsing
Probably, you can create new fields with the combination for the
groups and use the field collapsing feature to group the results.

Id Type1    Type2    Title Group1
1    a    b    xfg        ab
2    a    c    abd       ac
3    a    d    thm      ad
4    b    a    efd       ba
5    b    b    ikj        bb
6    b    c    azd      bc

It also provides the sort and a group sorting features.

Regards,
Jayendra

On Wed, Mar 2, 2011 at 6:37 AM, Rok Rejc <rokrej...@gmail.com> wrote:
> I have an index with a number of documents. For example (this example is
> representative and contains many others fields):
>
> Id    Type1    Type2    Title
> 1    a    b    xfg
> 2    a    c    abd
> 3    a    d    thm
> 4    b    a    efd
> 5    b    b    ikj
> 6    b    c    azd
> ...
>
> I want to query an index on a number of fields (not a problem), but I want
> to get results ordered in  a "groups", and after that (inside the group) I
> want to order result alphabeticaly by a Title.
>
> "Group" is not fixed but it is created in runtime. For example:
> - Group 1: documents with Type1=b and Type2=b.
> - Group 2: documents with Type1=a and Type2=b.
> - Group 3: documents with Type1=b and Type2=a.
> - Group 4: documents with Type1=b and Type2=c.
> ...
>
> So I want to retrieve results ordered by group (1,2,3,4) and after that
> alphabeticaly by a Title.
>
> I think that I should create a query where each group is seperated with OR
> operator, and boost each group with appropriate factor. After that I should
> order the results by this factor and title.
>
> Is this possible? Any suggestions are appreciated.
>
> Many thanks,
>
> Rok
>

Reply via email to