Thamaiyanthi
Thamaiyanthi

Reputation: 1

Solr query for alphabetical search

I have a solr-4.5.1, I need to get the results in alphabetical order, eg.. I have recipe title like (aa,abc,acb,ava,bca). I tried with the below params(q=&RecipeTitle=a*&fields=RecipeTitle) but its not giving the expected results. NOTE: recipe title is not stored.

Upvotes: 0

Views: 98

Answers (1)

Priyanka dudani
Priyanka dudani

Reputation: 255

You can use sort parameter in query and solr will return alphabetically ordered results

q=*&fl=RecipeTitle&sort=RecipeTitle+asc

Query to get results starting with a :

q=*&fq=RecipeTitle:a*&fl=RecipeTitle&sort=RecipeTitle+asc

Upvotes: 1

Related Questions