I need to do a pagination / navigation menu in Sphinx
*(for signs) 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
And to filter the results.
In the “A” page – just the results starting with “A”
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
But if you do mean sphinxsearch, something like this
Would give you a numeric attribute representing the first letter of the name. Can be used with setFilter to only return results matching that value.
Can even be used with setGroupBy to get the number of results matching each ordinal.
REF: http://www.asciitable.com/
—
Edit to add: Using a Integer Attribute – having got an integer via the mysql ORD function, because attr str2ordinal (nor string attributes for that matter!) allow filtering. Converting yourself to an integer like this allows filtering.
Eg to get only ‘A’ results, could do
This works because php’s ord function works the same way as mysql.