Hi Travis You got pretty close - the :ranker option in a search call ends up in the OPTION sections... so, :ranker => "expr(1+2)" will work.
Cheers -- Pat On 14 May 2014, at 10:18 am, Travis J I Corcoran <[email protected]> wrote: > > I've been using TS for a while now. Great product - thanks! > > I'm getting complaints from our users that the ranking of results is not > great. OK - Sphinx allows a lot of options. > > I've figured out WeightEnumeratorMask and I've figured out how to use :ranker > => SPH04 and that works decently...but there's so much more that can be done. > At least at the Sphinx level. > > Reading the Sphinx docs here > http://sphinxsearch.com/docs/current.html#ranking-factors > I see that I might want to sort by, say > > 5 * weight() + sum(lcs) + 2 * wordcount() > > I've tried to specify :ranker => 'expr', but then I get the error > > ThinkingSphinx::SphinxError: missing ranker expression (use OPTION > ranker=expr('1+2') for example) - SELECT *, sum(word_count) as custom FROM > `title_core` WHERE MATCH('Batman') AND `sphinx_deleted` = 0 ORDER BY `custom` > DESC LIMIT 0, 20 OPTION ranker=expr; SHOW META > > where do I put this > > OPTION ranker=expr('1+2') > > ? > > It doesn't go in the :select argument, because if I try that I get an error. > > tl;dr can someone supply an example that uses SPH_RANK_EXPR and a > moderately complex custom ranking algorithm? > > Many thanks! > > > Travis > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/thinking-sphinx. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/d/optout.
