none
Is RANK operator unusable with a fielded query term? RRS feed

  • Question

  • I'm attempting to run a query like this one in ESP:

    foo RANK title:bar

    but the results consistently show no change from a search for "foo", i.e. the RANK operator appears to be doing nothing.

    If I write the RANK term without the field specifier, though:

    foo RANK bar

    then I do see an effect on the result ranking.

    Is that what's supposed to be happening?  The documentation doesn't indicate that, and worse, it does appear to be working in FDS 4.x.  Has anything changed about this operator since then?

    If I can't fix this or work around it, it could be a major problem for me.  I really need to be able to adjust ranking based on the contents of a single field.

    Thanks,

    Matthias

    Monday, December 5, 2011 10:40 PM

Answers

  • The actual answer to this question, after extensive consultation with MS Support, turned out to be: the RANK operator only works on composite fields.  This is, needless to say, not in the documentation.  It was allegedly also true in FDS 4.x; it never became entirely clear why I seemed to be getting good results in our legacy installation of that version.  The workaround was to use XRANK, which was less than ideal but was the only remaining option.
    • Marked as answer by fermata1 Wednesday, February 22, 2012 1:04 AM
    Wednesday, February 22, 2012 1:04 AM

All replies

  • I've found a Microsoft support doc suggesting that this should work (see Example 4 at that link).

    I should note that I get the same behavior using the RANK prefix operator as I do with the infix operator.  That is to say,

    rank(foo, bar)

    works correctly, while

    rank(foo, title:bar)

    does not.  The support document referenced above uses the prefix notation only.



    • Edited by fermata1 Monday, December 5, 2011 11:15 PM
    Monday, December 5, 2011 11:14 PM
  • Hi Matthias,

    I would suggest that you try using XRANK, which is more efficient than RANK i.e  XRANK(foo, title:bar, boost=xxx)

    I believe the infix operation for RANK used the pling(!) operator. For example: Foo RANK bar!200

    The result of the above example would be that that documents must match the term 'foo', and any that match 'bar' will get a boost twice what they would have got without the !200 part.

    This is not field specific, but you can try foo RANK title:bar!200 , and see if this meets your needs.

    Thanks!

    Rob Vazzana | Sr Support Escalation Engineer | US Customer Service & Support

    Friday, December 9, 2011 7:35 PM
    Moderator
  • The actual answer to this question, after extensive consultation with MS Support, turned out to be: the RANK operator only works on composite fields.  This is, needless to say, not in the documentation.  It was allegedly also true in FDS 4.x; it never became entirely clear why I seemed to be getting good results in our legacy installation of that version.  The workaround was to use XRANK, which was less than ideal but was the only remaining option.
    • Marked as answer by fermata1 Wednesday, February 22, 2012 1:04 AM
    Wednesday, February 22, 2012 1:04 AM