Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: search
    • Labels:
      None

      Description

      Sometimes facet sort based only on the count of matches is not relevant, I need to sort not only by the count of matches, but also on the scores of matches.
      In the most simple way it must sort categories by the sum of item scores that matches query and the category. In the best way there should be some coefficient to multiply Scores or some function.
      Is it possible to implement such a behavior for facet sort?

        Activity

        Hide
        Peter Karich added a comment -

        Great there is someone else interesting in exactly this feature.

        Look here for a detailed description how we can make this more general:

        http://lucene.472066.n3.nabble.com/weighted-facets-td1683777.html

        Show
        Peter Karich added a comment - Great there is someone else interesting in exactly this feature. Look here for a detailed description how we can make this more general: http://lucene.472066.n3.nabble.com/weighted-facets-td1683777.html
        Hide
        Peter Karich added a comment -

        When I am thinking a bit more about this issue. For the 'ungeneralized version' - sorting against the maximum of the score (or any field?)- we can use the group-feature!

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

        The Solution - I think - would be the following request:

        http://localhost:8983/solr/select/?q=hard&group=true&group.field=manu_exact&group.limit=1&debug=true&fl=*,score

        the collapse groups are ordered by the maxScore I think + hope

        So it is the same as we want:

        http://localhost:8983/solr/select/?q=hard&facet=true&facet.field=manu_exact&debug=true&fl=*,score&facet.stats.sort=max(score) desc

        Now one remaing task could be to extend this feature with max, min and mean functions ...

        here is the 'group' result:

        <lst>
        <str name="groupValue">Maxtor Corp.</str>
        −
        <result name="doclist" numFound="1" start="0" maxScore="0.70904505">
        −
        <doc>
        <float name="score">0.70904505</float>
        −
        <arr name="cat">
        <str>electronics</str>
        <str>hard drive</str>
        </arr>
        −
        <arr name="features">
        <str>SATA 3.0Gb/s, NCQ</str>
        <str>8.5ms seek</str>
        <str>16MB cache</str>
        </arr>
        <str name="id">6H500F0</str>
        <bool name="inStock">true</bool>
        <str name="manu">Maxtor Corp.</str>
        <date name="manufacturedate_dt">2006-02-13T15:26:37Z</date>
        −
        <str name="name">
        Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300
        </str>
        <int name="popularity">6</int>
        <float name="price">350.0</float>
        <str name="store">45.17614,-93.87341</str>
        </doc>
        </result>
        </lst>
        −
        <lst>
        <str name="groupValue">Samsung Electronics Co. Ltd.</str>
        −
        <result name="doclist" numFound="1" start="0" maxScore="0.5908709">
        −
        <doc>
        <float name="score">0.5908709</float>
        −
        <arr name="cat">
        <str>electronics</str>
        <str>hard drive</str>
        </arr>
        −
        <arr name="features">
        <str>7200RPM, 8MB cache, IDE Ultra ATA-133</str>
        −
        <str>
        NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor
        </str>
        </arr>
        <str name="id">SP2514N</str>
        <bool name="inStock">true</bool>
        <str name="manu">Samsung Electronics Co. Ltd.</str>
        <date name="manufacturedate_dt">2006-02-13T15:26:37Z</date>
        −
        <str name="name">
        Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133
        </str>
        <int name="popularity">6</int>
        <float name="price">92.0</float>
        <str name="store">45.17614,-93.87341</str>
        </doc>
        </result>
        </lst>
        

        this would be the faceting result:

        <lst name="facet_fields">
        <lst name="manu_exact">
        <int name="Maxtor Corp." score="0.70904505">1</int>
        <int name="Samsung Electronics Co. Ltd." score="0.5908709">1</int>
        ...
        
        Show
        Peter Karich added a comment - When I am thinking a bit more about this issue. For the 'ungeneralized version' - sorting against the maximum of the score (or any field?)- we can use the group-feature! http://wiki.apache.org/solr/FieldCollapsing The Solution - I think - would be the following request: http://localhost:8983/solr/select/?q=hard&group=true&group.field=manu_exact&group.limit=1&debug=true&fl=*,score the collapse groups are ordered by the maxScore I think + hope So it is the same as we want: http://localhost:8983/solr/select/?q=hard&facet=true&facet.field=manu_exact&debug=true&fl=*,score&facet.stats.sort=max(score ) desc Now one remaing task could be to extend this feature with max, min and mean functions ... here is the 'group' result: <lst> <str name= "groupValue" >Maxtor Corp.</str> − <result name= "doclist" numFound= "1" start= "0" maxScore= "0.70904505" > − <doc> < float name= "score" >0.70904505</ float > − <arr name= "cat" > <str>electronics</str> <str>hard drive</str> </arr> − <arr name= "features" > <str>SATA 3.0Gb/s, NCQ</str> <str>8.5ms seek</str> <str>16MB cache</str> </arr> <str name= "id" >6H500F0</str> <bool name= "inStock" > true </bool> <str name= "manu" >Maxtor Corp.</str> <date name= "manufacturedate_dt" >2006-02-13T15:26:37Z</date> − <str name= "name" > Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300 </str> < int name= "popularity" >6</ int > < float name= "price" >350.0</ float > <str name= "store" >45.17614,-93.87341</str> </doc> </result> </lst> − <lst> <str name= "groupValue" >Samsung Electronics Co. Ltd.</str> − <result name= "doclist" numFound= "1" start= "0" maxScore= "0.5908709" > − <doc> < float name= "score" >0.5908709</ float > − <arr name= "cat" > <str>electronics</str> <str>hard drive</str> </arr> − <arr name= "features" > <str>7200RPM, 8MB cache, IDE Ultra ATA-133</str> − <str> NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor </str> </arr> <str name= "id" >SP2514N</str> <bool name= "inStock" > true </bool> <str name= "manu" >Samsung Electronics Co. Ltd.</str> <date name= "manufacturedate_dt" >2006-02-13T15:26:37Z</date> − <str name= "name" > Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133 </str> < int name= "popularity" >6</ int > < float name= "price" >92.0</ float > <str name= "store" >45.17614,-93.87341</str> </doc> </result> </lst> this would be the faceting result: <lst name= "facet_fields" > <lst name= "manu_exact" > < int name= "Maxtor Corp." score= "0.70904505" >1</ int > < int name= "Samsung Electronics Co. Ltd." score= "0.5908709" >1</ int > ...
        Hide
        Grant Ingersoll added a comment -

        To make this slightly more generic, I think we should be able to support other sort capabilities for faceting. For instance, it is common to want to have editorial sorting, too, whereby I can make sure some specific facet is in the top facet results, kind of like what the QueryElevationComponent does.

        Show
        Grant Ingersoll added a comment - To make this slightly more generic, I think we should be able to support other sort capabilities for faceting. For instance, it is common to want to have editorial sorting, too, whereby I can make sure some specific facet is in the top facet results, kind of like what the QueryElevationComponent does.
        Hide
        Erick Erickson added a comment -

        Cleaning up old JIRAs, re-open if necessary.

        Show
        Erick Erickson added a comment - Cleaning up old JIRAs, re-open if necessary.
        Hide
        Christian Grobmeier added a comment -

        Using the group function doesn't work when you work with a multivalue field.

        I have exactly the problem that I want to create some suggestion out of a multivalue field (locations). When I write "Munich" then not "Munich" is shown first even when this is an exact match. Other places are shown first, because they have simply more counts.

        Show
        Christian Grobmeier added a comment - Using the group function doesn't work when you work with a multivalue field. I have exactly the problem that I want to create some suggestion out of a multivalue field (locations). When I write "Munich" then not "Munich" is shown first even when this is an exact match. Other places are shown first, because they have simply more counts.
        Hide
        Erick Erickson added a comment -

        Christian:

        Please don't add comments to old JIRAs, they'll only be seen by chance. If you raise this question on the user's list, it'll be much more likely to generate help. See: https://lucene.apache.org/solr/discussion.html

        Show
        Erick Erickson added a comment - Christian: Please don't add comments to old JIRAs, they'll only be seen by chance. If you raise this question on the user's list, it'll be much more likely to generate help. See: https://lucene.apache.org/solr/discussion.html

          People

          • Assignee:
            Unassigned
            Reporter:
            Dmitry Degtyarev
          • Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development