The use of $$rank

rluan
Posts: 29
Joined: Mon Jul 23, 2001 1:22 pm

The use of $$rank

Post by rluan »

HOw does '$$rank' in a Vortex sql block following 'select'keyword work to define the sorting order? It seems that there is no specification of $$rank in the Vortex manual, or it is somewhere but I can not find it. Thanks.
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

The use of $$rank

Post by bart »

To use it in Vortex, do the following:

<sql "select $$rank Rank,Field1, Field2... where FieldX likep $query">
$Rank $Field....
</sql>

$$rank returns values 0 to 1000 based on the quality of the match, 1000 being the best. If you prefer it scaled back do the following:

<sql "select $$rank/100 Rank,Field1, Field2... where FieldX likep $query">
$Rank $Field....
</sql>

A query for "rank" on our site produces documentation (master.com does not
index the $ as perhaps it should)
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

The use of $$rank

Post by John »

$$rank is not really part of Vortex, $rank is a variable that gets set during search queries. You can see more information at http://www.thunderstone.com/site/texisman/node51.html

Selecting $rank does not define a sort order. LIKEP and LIKER will by default sort by $rank descending.
John Turnbull
Thunderstone Software
rluan
Posts: 29
Joined: Mon Jul 23, 2001 1:22 pm

The use of $$rank

Post by rluan »

John said "Selecting $rank does not define a sort order. LIKEP and LIKER will by default sort by $rank descending."

When I used 'order by Visited' combined with '$$rank Rank' in a LIKIP statement, it seems that these two sorting standards, $rank descending and 'Visited order', conflict each and the results are not sorted in either one. Did anyone meet similar problem? When I only use one by either deleting '$$rank Rank' or deleting 'order by Visited', it works fine. It confused me a lot. Thanks.
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

The use of $$rank

Post by John »

Selecting $$rank should have no impact on the order of results. If you specify an explicit ORDER BY then that is used.

If you are not seeing that behavior then please open a support ticket on the website at http://www.thunderstone.com/texis/site/ ... pport.html and provide enough information to reproduce it.
John Turnbull
Thunderstone Software