29.11.11

Sort facet by name using toTitlecase(value) expression


When using the text facet option, google refine, sort all available value either by choice count or by name. When sorting by name, all values will be sorted by number first and then by alphabetical order (capital first and then lower case) into something like this:



  • 123
  • Aaron
  • Bernard
  • Claire
  • aaron
  • bernard
  • john

To display Aaron and aaron into one unique facet, click on change and update the expression by adding toUppercase(value).



Google refine will facet all the value based on their title case without modifying any records. The facet will display the following, thus limiting the number of value to chose from:
  • 123
  • AARON
  • BERNARD
  • CLAIRE
  • JOHN

You can also do this with the following expression: 
  • toLowercase  will display all value in lower case,
  • toUppercase will display all value in upper case,
  • toTitlecase will display all value in title case (first letter of every word in upper case and the rest of it in lower case)

This post was

0 comments:

Post a Comment