php-frontend Digest 11 May 2006 15:14:26 -0000 Issue 121
Topics (messages 959 through 961):
Webboard: Using suggest=yes with php front-end
959 by: nobody.mnogosearch.org
960 by: nobody.mnogosearch.org
961 by: Yannick Warnier
Administrivia:
To subscribe to the digest, e-mail:
<php-frontend-digest-subscribe mnogosearch.org>
To unsubscribe from the digest, e-mail:
<php-frontend-digest-unsubscribe mnogosearch.org>
To post to the list, e-mail:
<php-frontend mnogosearch.org>
------------------------------------------------------------
----------
Author: Mark
Email: mjoh090 actrix.co.nz
Message:
The $WS variable is being recognised as simply $W which is
the variable for displaying Search results. This explains
the extra 'S' at the end of the suggestion. I am using
php-frontend-1.96 and mnogosearch 3.2.38.
changing the variable allocation for Suggestion in the
search.php file - (if (!$found) {
$ws='';
if ((Udm_Api_Version() >= 30233) &&
($suggest=='yes')) {
$ws=Udm_Get_Agent_Param_Ex($udm_agent,'WS');
})
does not help.
Any suggestions would be greatly appreciated.
Mark
Reply: <http://www.mnogosearch.org/board/message.php?id=18006&g
t;
Author: Mark
Email: mjoh090 actrix.co.nz
Message:
Typing the incorrect spelling for accounting as
'accountin' into the search form of search.php generates
the following suggestion - "Did you mean accountin :
0 / 198225S ?."
The relavant code in Search.htm is configured to
<b><a
href="?q=$%(WS)">$WS</a></b> .
The original distribution search.htm file for the the php
front-end however had the following cofiguration
<b><a
href="?q=$%(WS)">$(WS)</a></b>
(the difference is the brackets around WS) that produced the
following null result - "Did you mean $(WS)".
The php front-end clearly only supports the no-brackets
syntax - $WS. The variable $WS appears valid, but if it is
still the wrong variable to use, then which variable is the
right one to use? If the right variable is being used, then
why am I not getting a valid suggestion?
Mark
Reply: <http://www.mnogosearch.org/board/message.php?id=18004&g
t;
Le lundi 08 mai 2006 à 15:03 +0000, nobody mnogosearch.org a écrit :
> Author: Mark
> Email: mjoh090 actrix.co.nz
> Message:
> The $WS variable is being recognised as simply $W which
is the variable for displaying Search results. This explains
the extra 'S' at the end of the suggestion. I am using
php-frontend-1.96 and mnogosearch 3.2.38.
>
> changing the variable allocation for Suggestion in the
search.php file - (if (!$found) {
> $ws='';
> if ((Udm_Api_Version() >= 30233) &&
($suggest=='yes')) {
> $ws=Udm_Get_Agent_Param_Ex($udm_agent,'WS');
> })
>
> does not help.
>
Hello Mark,
The PHP frontend has not been updated much recently. A long
time ago, I
have submitted a patch for the word suggestion.
Here is a copy of the e-mail I sent about that. I think it
should solve
your problem.
Le lundi 24 octobre 2005 à 21:14 +0300, Sergey Kartashoff a
écrit :
> Hello.
>
> Monday, October 24, 2005, 9:00:03 PM, you wrote:
>
> YW> I also have some updates to suggest considering
the Word
Suggestion
> YW> feature (using $ws if I remember well). I'll
send that here as
soon as I
> YW> get a chance.
>
> ok, i will wait till your update.
OK, so to use the "Word suggestion" feature
(this is mentionned in the
mnogosearch search.htm file), you have to specify
Suggest yes
in search.htm, but you also have to launch the indexer with
the option
-Ewordstat in order to make it work.
But the php frontend doesn't handle that, so to make it
work, you need
to add the $ws parameter inside the print_template()
function in
template.inc.
To do this, I added the $ws parameter on line 352
(approximately) like
this:
global $nav, $wordinfo, $ws, $doclang, $doccharset,
$storedocurl;
and on line 376
$str=ereg_replace('\$\(WS\)', $ws, $str);
Then the suggestion actually appears when you search for a
word that
doesn't give any result but that has a close match in the
database.
It also looks like, inside search.htm, you should change
this line:
Did you mean <b><a
href="?q=$%(WS)">$(WS)</a></b> ?
By removing the '%' character:
Did you mean <b><a
href="?q=$(WS)">$(WS)</a></b> ?
That works for me, and it is a very nice feature to have in
the search
interface.
Yannick
|