Budd, Sinclair's bits of Tue, 11 Jun 2002 translated to:

>I am using Dig 3.2.0b4-20020505 .
>I do not seem to be able to order the results by the use of
>search_results_order  configuration attribute.
>such as   search_results_order:   www.cts *
>Is there anything I can  do to rectify this.

It appears that a bit of the code associated with that
functionality broke at some point. I am attaching a patch that
seems to fix the problem. The patch is against the
htdig-3.2.0b4-20020609 snapshot. It is just my best guess at a
reasonable fix, so use at your own risk and all that ;)

The patch addresses two problems that I found. The first was that
in Display::buildMatchList(), the call to matches.Add() was
always passing an empty string for the URL. The second was that
the value returned from MatchArea::Match() was always opposite of
what it should have been.

Jim
diff -u orig-htdig-3.2.0b4-20020609/htsearch/Display.cc 
htdig-3.2.0b4-20020609/htsearch/Display.cc
--- orig-htdig-3.2.0b4-20020609/htsearch/Display.cc     Wed Jul 11 14:07:24 2001
+++ htdig-3.2.0b4-20020609/htsearch/Display.cc  Wed Jun 12 02:22:24 2002
@@ -1452,9 +1452,6 @@
 
        score = adjustments.adjust_score(score, thisRef->DocURL());
 
-       // Get rid of it to free the memory!
-       delete thisRef;
-
        score = log(1.0 + score);
        thisMatch->setScore(score);
        thisMatch->setAnchor(dm->anchor);
@@ -1462,7 +1459,10 @@
        //
        // Append this match to our list of matches.
        //
-       matches.Add(thisMatch, url.get());
+       matches.Add(thisMatch, thisRef->DocURL());
+
+       // Get rid of it to free the memory!
+       delete thisRef;
 
         if (debug)
         {
diff -u orig-htdig-3.2.0b4-20020609/htsearch/SplitMatches.cc 
htdig-3.2.0b4-20020609/htsearch/SplitMatches.cc
--- orig-htdig-3.2.0b4-20020609/htsearch/SplitMatches.cc        Mon May  8 14:40:43 
2000
+++ htdig-3.2.0b4-20020609/htsearch/SplitMatches.cc     Wed Jun 12 02:21:31 2002
@@ -42,7 +42,7 @@
 
     // Does this item match?
     inline bool Match(char *s)
-    { return match.match(s, 1, 0) == 0; }
+    { return match.match(s, 1, 0) == 1; }
 
     // Return the contained list.
     List *MatchList() { return &myList; }

Reply via email to