Hey
I finally got htsearch working with PHP, but it's still not working
correctly.
The first problem I'm having is that searches don't always work. I'll do a
search, it'll show the results, but then if I try to search again, it will
show NO MATCHES (even if it's the exact same search). Is there some kind of
time configuartion that won't allow searches within a certain amount of time
or soemthing? Any ideas?
The other problem is that I can't run an advanced query. The only thing
that works is "words=$words". But if I try to change it to
"words=$words&page=$page" where $page may be a 1 or a 2, I always get a NO
MATCHES. The funny thing about this is when I run it from the command-line
with the following: ./htsearch -c
/home/sites/site21/local/htdig/conf/roguespear.conf words=nato&page=2 <-
It will DO the search, but STILL show only page 1, and also when the program
executes int he command line, it shwos that it executed the following only:
./htsearch -c /home/sites/site21/local/htdig/conf/roguespear.conf words=nato
<- doesn't even show the page=2 part. Any ideas why this is happening?
I've pasted the code I'm using below:
----
if(!$page)
{
$page = 1;
}
if(!$matches)
{
$matches = 20;
}
if(!$method)
{
$method = "or";
}
if(!$sort)
{
$sort = "score";
}
$words = EscapeShellCmd(UrlEncode($search));
$config = "roguespear";
$format = "roguespear";
$query = "words=$words";
$command="/home/sites/site21/local/htdig/bin/htsearch -c
/home/sites/site21/local/htdig/conf/roguespear.conf $query";
exec($command,$result);
$rc = count($result);
//while (list($k,$v)=each($result)) {
// echo "$v<br>";
// }
if($rc < 2)
{
title("Search - Error");
show_error("There was an error executing the search. Please try again
later.<br><br>");
}
elseif($result[2] == "NOMATCH")
{
title("Search - No Matches");
show_error("There were no matches for <b>" . $search . "</b> on the web
site.");
}
elseif($result[2] == "SYNTAXERROR")
{
title("Search - Error");
show_error("There is a syntax error in your search for
<b>$search</b>:<br><br>" . $result[3] . "</PRE>\n");
}
else
{
..display results
----
Thanks in advance - I'm SO close to having this thing work right!
- Mike Aeberhard
http://www.roguespeardatabase.com
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html
[htdig] htsearch works Intermittenly - also can't run advanced queries - PHP
Michael \"NightEye\" Aeberhard Sun, 15 Jul 2001 13:21:49 -0700
- Re: [htdig] htsearch works Interm... Michael \"NightEye\" Aeberhard
- Re: [htdig] htsearch works I... Dan Langille
- Re: [htdig] htsearch works I... Gilles Detillieux
- RE: [htdig] htsearch works I... Michael \"NightEye\" Aeberhard
- RE: [htdig] htsearch works I... Dan Langille
- RE: [htdig] htsearch works I... Michael \"NightEye\" Aeberhard
- RE: [htdig] htsearch wor... Dan Langille

