# Acts\_as\_sphinx - options\[:sort\_mode\] = \[:attr\_desc, 'purchase\_count'\]

**URL:** <https://www.ruby-forum.com/t/acts-as-sphinx-options-sort-mode-attr-desc-purchase-count/129572>\
**Category:** Rails\
**Created:** [February 19, 2008, 7:46pm UTC](https://www.ruby-forum.com/t/acts-as-sphinx-options-sort-mode-attr-desc-purchase-count/129572 "2008-02-19T19:46:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [February 19, 2008, 7:46pm UTC](https://www.ruby-forum.com/t/acts-as-sphinx-options-sort-mode-attr-desc-purchase-count/129572/1 "2008-02-19T19:46:02Z")

</div>

Railsers:

I can’t find acts\_as\_sphinx’s forum, so I must throw this question open:

We have installed acts\_as\_sphinx and set almost everything up. The only  
issue is  
getting the :sort\_mode working. Now we want to rank products by number  
of purchases.

When we pass the above options to ask\_sphinx, we just get a 105 error  
out of  
getResponse().

Sphinx says that purchase\_count is a valid column in its index. But the  
search  
command line tool does not seem to accept that sort mode, so we can’t  
cross-check.

Any ideas?

Also, can we get a GetLastError() out of the Sphinx, to get 105 in  
English?

–  
Phlip  
[http://assert2.rubyforge.org/](http://assert2.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [February 19, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/acts-as-sphinx-options-sort-mode-attr-desc-purchase-count/129572/2 "2008-02-19T21:55:20Z")

</div>

On Feb 19, 10:43 am, Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sphinx says that purchase\_count is a valid column in its index. But the search  
> command line tool does not seem to accept that sort mode, so we can’t cross-check.
> 
> Any ideas?
> 
> Also, can we get a GetLastError() out of the Sphinx, to get 105 in English?
> 
> –  
> Phlip  
> [http://assert2.rubyforge.org/](http://assert2.rubyforge.org/)

dunno answer, but here’s forum:

[http://www.sphinxsearch.com/forum/index.html](http://www.sphinxsearch.com/forum/index.html)

---

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [February 20, 2008, 8:09pm UTC](https://www.ruby-forum.com/t/acts-as-sphinx-options-sort-mode-attr-desc-purchase-count/129572/3 "2008-02-20T20:09:05Z")

</div>

> > Any ideas?
> > 
> > Also, can we get a GetLastError() out of the Sphinx, to get 105 in English?

> dunno answer, but here’s forum:
> 
> [Sphinx | Open Source Search Server](http://www.sphinxsearch.com/forum/index.html)

Thanks, but they are not likely to know why acts\_as\_sphinx doesn’t call  
GetLastError…!
