Skip to main content
September 28, 2010
Question

Control the output order of a CFSearch

  • September 28, 2010
  • 2 replies
  • 1905 views

What is the proper procedure to take the return from a CFSearch and set the order based on one of the fields to be displayed in numerical, alphabetical, whatever?

I understand how to use the result of the CFSearch to index into another source but that's one record at a time.  I want to re-order the cfsearch output to be in a defined order rather than the returned order based on ranking if I understand the process correctly.

What to do?

    This topic has been closed for replies.

    2 replies

    Inspiring
    September 28, 2010

    Do you mean:

    * reorganise the result set (query) that comes back from <cfsearch>?  If so Bob is on the button there.  Plus any other query functionality that CF offers;

    * or to change the weighting on how the results come out?  I'm not sure one can do that.

    That said, the whole thing about using a search engine is that it gives you the answers in order of the relevance of what you were looking for.  And even Verity does an adequate job of doing this.  What's the reason for wanting to present it differently?

    --

    Adam

    September 28, 2010

    Basically we want to search a large inventory database and the client would like the output in an Alpha format.  I figured that the verity search would be the easiest way to parse through the data as well as allow for using wildcard chars.

    I can get what I want except that I don't quite understand how to take the cfsearch return and then re-sort the data.

    I'm using CF8 if it makes a difference.

    I'm sorry that I'm not advanced enough yet to figure this out myself and really do appreciate the help.

    Inspiring
    September 29, 2010

    Basically we want to search a large inventory database and the client would like the output in an Alpha format.  I figured that the verity search would be the easiest way to parse through the data as well as allow for using wildcard chars.

    Ah right.  I probably would not use Verity to do that.  I'd use your DB's free-text search capabilities for this sort of thing, and do the work on the DB rather than getting Verity to drag it all out, then use CF to re-order it.

    I can get what I want except that I don't quite understand how to take the cfsearch return and then re-sort the data.

    This has been covered in previous responses: query on query will effect this.  However I don't think Verity & QoQ is the best approach to the requirement, now that I better understand what the requirement is.

    --
    Adam

    Inspiring
    September 28, 2010

    You can use the "Query of Queries" feature to manipulate the resultset returned by the CFSEARCH tag.

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7bb8.html