You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Johannes Riedl <jo...@uni-tuebingen.de> on 2015/11/23 15:43:07 UTC

Custom Facet Scoring

Hi all,

we would like to add a custom sorting for facets in addition to the 
existing 'index' and 'count' that can be passed by a new value for the 
facet.sort parameter. The aim is to achieve a prefix based sorting for 
all the terms of a complex field with entries of the form AAAA / BBBB / 
CCCC and sorting can be triggered by specifying something like 
facet.sort=mysortorder.
We added a new searchComponent in solrconfig.xml that overrides the 
default "facet" component and currently use a skeleton FacetComponent in 
a different namespace. Is there a clean way to access and extend the 
dependencies the default FacetComponent uses - especially extending the 
FacetParam class by a new value FACET_SORT_MYSORTORDER - without having 
to touch the orginal Solr code?

Thanks a lot for your information, best regards

Johannes

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Custom Facet Scoring

Posted by Johannes Riedl <jo...@uni-tuebingen.de>.
Thanks a lot for your feedback - I will try to pursue the approach 
indicated and see how far we can get.

On 24.11.2015 01:46, Ryan Josal wrote:
> I don't have the time to work on this issue right now, but I can 
> definitely help test it and port my facet sort to it if somebody works 
> on it to see how it works.
>
> On Monday, November 23, 2015, Mikhail Khludnev 
> <mkhludnev@griddynamics.com <ma...@griddynamics.com>> wrote:
>
>     Hello Colleagues,
>
>     I'll commit if you provide a patch, attached to the jira of
>     course. But it should work with SolrCloud too.
>
>     On Mon, Nov 23, 2015 at 9:05 PM, Ryan Josal <ryan@josal.com
>     <javascript:_e(%7B%7D,'cvml','ryan@josal.com');>> wrote:
>
>         +1 for making new facet sorts easier to implement.  I
>         implemented an order where the come back in order they are
>         first seen in the doclist, but it didn't come out very clean. 
>         My approach was to extend FacetComponent, and resort the
>         facets by pulling them out of the results and putting them
>         back (after hacking facet.limit to get them all).  Some sort
>         of plugin behavior for it would be great, but I expect there
>         are some complexities with it.  Anyway I'd be interested to
>         hear about good ways to do this.
>
>
>         On Monday, November 23, 2015, Johannes Riedl
>         <johannes.riedl@uni-tuebingen.de
>         <javascript:_e(%7B%7D,'cvml','johannes.riedl@uni-tuebingen.de');>>
>         wrote:
>
>             Hi all,
>
>             we would like to add a custom sorting for facets in
>             addition to the existing 'index' and 'count' that can be
>             passed by a new value for the facet.sort parameter. The
>             aim is to achieve a prefix based sorting for all the terms
>             of a complex field with entries of the form AAAA / BBBB /
>             CCCC and sorting can be triggered by specifying something
>             like facet.sort=mysortorder.
>             We added a new searchComponent in solrconfig.xml that
>             overrides the default "facet" component and currently use
>             a skeleton FacetComponent in a different namespace. Is
>             there a clean way to access and extend the dependencies
>             the default FacetComponent uses - especially extending the
>             FacetParam class by a new value FACET_SORT_MYSORTORDER -
>             without having to touch the orginal Solr code?
>
>             Thanks a lot for your information, best regards
>
>             Johannes
>
>             ---------------------------------------------------------------------
>             To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>             For additional commands, e-mail: dev-help@lucene.apache.org
>
>
>
>
>     -- 
>     Sincerely yours
>     Mikhail Khludnev
>     Principal Engineer,
>     Grid Dynamics
>
>
>     <javascript:_e(%7B%7D,'cvml','mkhludnev@griddynamics.com');>
>


Re: Custom Facet Scoring

Posted by Ryan Josal <ry...@josal.com>.
I don't have the time to work on this issue right now, but I can definitely
help test it and port my facet sort to it if somebody works on it to see
how it works.

On Monday, November 23, 2015, Mikhail Khludnev <mk...@griddynamics.com>
wrote:

> Hello Colleagues,
>
> I'll commit if you provide a patch, attached to the jira of course. But it
> should work with SolrCloud too.
>
> On Mon, Nov 23, 2015 at 9:05 PM, Ryan Josal <ryan@josal.com
> <javascript:_e(%7B%7D,'cvml','ryan@josal.com');>> wrote:
>
>> +1 for making new facet sorts easier to implement.  I implemented an
>> order where the come back in order they are first seen in the doclist, but
>> it didn't come out very clean.  My approach was to extend FacetComponent,
>> and resort the facets by pulling them out of the results and putting them
>> back (after hacking facet.limit to get them all).  Some sort of plugin
>> behavior for it would be great, but I expect there are some complexities
>> with it.  Anyway I'd be interested to hear about good ways to do this.
>>
>>
>> On Monday, November 23, 2015, Johannes Riedl <
>> johannes.riedl@uni-tuebingen.de
>> <javascript:_e(%7B%7D,'cvml','johannes.riedl@uni-tuebingen.de');>> wrote:
>>
>>> Hi all,
>>>
>>> we would like to add a custom sorting for facets in addition to the
>>> existing 'index' and 'count' that can be passed by a new value for the
>>> facet.sort parameter. The aim is to achieve a prefix based sorting for all
>>> the terms of a complex field with entries of the form AAAA / BBBB / CCCC
>>> and sorting can be triggered by specifying something like
>>> facet.sort=mysortorder.
>>> We added a new searchComponent in solrconfig.xml that overrides the
>>> default "facet" component and currently use a skeleton FacetComponent in a
>>> different namespace. Is there a clean way to access and extend the
>>> dependencies the default FacetComponent uses - especially extending the
>>> FacetParam class by a new value FACET_SORT_MYSORTORDER - without having to
>>> touch the orginal Solr code?
>>>
>>> Thanks a lot for your information, best regards
>>>
>>> Johannes
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: dev-help@lucene.apache.org
>>>
>>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <javascript:_e(%7B%7D,'cvml','mkhludnev@griddynamics.com');>
>

Re: Custom Facet Scoring

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello Colleagues,

I'll commit if you provide a patch, attached to the jira of course. But it
should work with SolrCloud too.

On Mon, Nov 23, 2015 at 9:05 PM, Ryan Josal <ry...@josal.com> wrote:

> +1 for making new facet sorts easier to implement.  I implemented an order
> where the come back in order they are first seen in the doclist, but it
> didn't come out very clean.  My approach was to extend FacetComponent, and
> resort the facets by pulling them out of the results and putting them back
> (after hacking facet.limit to get them all).  Some sort of plugin behavior
> for it would be great, but I expect there are some complexities with it.
> Anyway I'd be interested to hear about good ways to do this.
>
>
> On Monday, November 23, 2015, Johannes Riedl <
> johannes.riedl@uni-tuebingen.de> wrote:
>
>> Hi all,
>>
>> we would like to add a custom sorting for facets in addition to the
>> existing 'index' and 'count' that can be passed by a new value for the
>> facet.sort parameter. The aim is to achieve a prefix based sorting for all
>> the terms of a complex field with entries of the form AAAA / BBBB / CCCC
>> and sorting can be triggered by specifying something like
>> facet.sort=mysortorder.
>> We added a new searchComponent in solrconfig.xml that overrides the
>> default "facet" component and currently use a skeleton FacetComponent in a
>> different namespace. Is there a clean way to access and extend the
>> dependencies the default FacetComponent uses - especially extending the
>> FacetParam class by a new value FACET_SORT_MYSORTORDER - without having to
>> touch the orginal Solr code?
>>
>> Thanks a lot for your information, best regards
>>
>> Johannes
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Custom Facet Scoring

Posted by Ryan Josal <ry...@josal.com>.
+1 for making new facet sorts easier to implement.  I implemented an order
where the come back in order they are first seen in the doclist, but it
didn't come out very clean.  My approach was to extend FacetComponent, and
resort the facets by pulling them out of the results and putting them back
(after hacking facet.limit to get them all).  Some sort of plugin behavior
for it would be great, but I expect there are some complexities with it.
Anyway I'd be interested to hear about good ways to do this.

On Monday, November 23, 2015, Johannes Riedl <
johannes.riedl@uni-tuebingen.de> wrote:

> Hi all,
>
> we would like to add a custom sorting for facets in addition to the
> existing 'index' and 'count' that can be passed by a new value for the
> facet.sort parameter. The aim is to achieve a prefix based sorting for all
> the terms of a complex field with entries of the form AAAA / BBBB / CCCC
> and sorting can be triggered by specifying something like
> facet.sort=mysortorder.
> We added a new searchComponent in solrconfig.xml that overrides the
> default "facet" component and currently use a skeleton FacetComponent in a
> different namespace. Is there a clean way to access and extend the
> dependencies the default FacetComponent uses - especially extending the
> FacetParam class by a new value FACET_SORT_MYSORTORDER - without having to
> touch the orginal Solr code?
>
> Thanks a lot for your information, best regards
>
> Johannes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>