[ 
https://issues.apache.org/jira/browse/SOLR-9665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15623462#comment-15623462
 ] 

David Smiley commented on SOLR-9665:
------------------------------------

If the field is numeric (not a String that happens to contain a number), then 
the "JSON Facet API" will interpret the "index" sort order as the numeric sort 
of the field value.  I just verified it worked:

http://localhost:8983/solr/techproducts/select?json.facet.price.terms.field=price&json.facet.price.terms.sort=index&indent=on&q=*:*&rows=1&wt=json

(in that example, it's a coincidence of the example data that it's the same as 
count order)

Docs: https://cwiki.apache.org/confluence/display/solr/Faceted+Search

p.s. yes it's a shame we have multiple faceting modules, which is confusing to 
users.  In time I hope JSON Facet API takes over.

> Facet Values Sort Order: Add 3rd choice: Numeric Sort
> -----------------------------------------------------
>
>                 Key: SOLR-9665
>                 URL: https://issues.apache.org/jira/browse/SOLR-9665
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: faceting
>            Reporter: Luke P Warwick
>
> As a person, I need facet values to be in predictable, intuitive spots so 
> that I can quickly and easily find the values that are appropriate to me.
> Problem Statement: Today Solr has two default facet sort orders, neither of 
> which provides predictable, intuitive facet value orders for people when the 
> values start with numbers.  
> Goal: Address the problem where index sorts facet values how a computer would 
> rather than how a human would.  This is very problematic for E-commerce 
> facets like 'size' and 'tire width'
> Acceptance Criteria:
> 1. Sorts facet values numerically from lowest to highest
> 2. Works with both numeric and string fields (thus working on values that 
> include letters... 25 mm, 30 waist, 32 Waist, 4 Petite)
> 3. If facet values don't start with a number, they are sorted alphabetically, 
> after all values that do start with a number
> 4. If facet values are equal numerically, sort the numerically equal values 
> alphabetically. Example: 10,10 Petite,10 Tall,12, Petite, 12 Tall
> 5. Integers and Floats are supported (even if string field)
> Examples:
> Women's Pants Sizes:
> 8
> 8 Tall
> 10
> 10 Petite
> 10 Tall
> 12
> 12 Tall
> 14 Petite
> 26 Waist
> 28 Waist
> 30 Waist
> One Size
> Bike Wheel Sizes:
> 20 Inches
> 24 Inches
> 26 Inches
> 27 Inches
> 27.5 Inches
> 27.5+ Inches
> 29 Inches
> 650c
> 700c



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to