Geek Speak — HabitableZone

Geek Speak » in reply to Some thoughts on search engines and Google in particular

Not quite what I had in mind. . .

All that stuff affects the searchability of the site by an external search engine like Google. The kind of search engine we really need runs on the server, and knows how to read XML files directly. Justin mentioned in an email a while back that he was thinking of writing a searching engine in the Perl scripting language. That might work. Another option I can explore is to write an interface module for Microsoft's Index Server (built in to Windows 2000) that knows how to read the XML format and put it into a form that Index Server can deal with. The downside is, of course, that I or Justin have to spend some time doing it. We're both pretty busy with other things, and I guess the search feature keeps slipping down the priority list when other things keep coming up. I'd like to have a search engine, gawd knows nobody lets me forget that we need one, but I can't make any promises about when it'll happen.


This changes things, I did not know you were generating html files form XML, and that all the historical data were in xml itself. . .

no wait actually it doen't generate on the fly you say?

Heres what happens. . .

You install SQL, could be any brand, ORACLE, MySQL, whatever. . . I write two scripts, one to parse the xml threads into the index (that will be the headache, but wil take care of the historical content), and one to parse exsiting html files into the index (this is how we update the index with new content as people make new posts.) I can take the later script from an off the shelf one I just used a few months back to populate an SQL database fo the army (that was a far greater beast to tackle than this I assure you). . .

and then drop this php (or do one our of PERL i guess, or perhaps even ASP? its simple enough, I learn enough ASP to this) that looks like this (really! thats all it takes!) to take a query form a submit form and extract it from a database:

"<?php

$year = $_GET['year'];
$month = $_GET['month'];
$body = $_GET['body'];
$query = "SELECT * FROM "; $query .= $database; $query .= "_devel";

$query .= " WHERE "; $query .= $database; $query .= "_BODY LIKE '% $body %'";
$db = mysql_connect("localhost","root") or die(mysql_error());
mysql_select_db("HZ_database", $db) or die(mysql_error());
$result = mysql_query($query, $db) or die(mysql_error());

while ($myrow = mysql_fetch_row($result))
{
echo "<table class=\"srw\" cellpadding=0 cellspacing=0 border=0>"<tr>;lt&td class=\"srw\">"<a class=\"srh\"> ",$myrow[4],""</a> - "<a class=\"srh\" href=\"#\"";
echo " onClick=\"Change_Map('Preview','preview.php?report=",$report,"&serial=$myrow[4]&search=",$body,"')\"";
echo ">Preview"</a> - "<a class=\"srh\" href=",$myrow[1],">Download"</a>"</td>"</tr>"<tr>"<td cellpadding=3 class=\"srb\">",$myrow[9],""</td>"</tr>"<tr>"<td class=\"srw\">"<a class=\"srt\">",$myrow[1]," ",$myrow[2]," - ", $myrow[5]," ", $myrow[6],""</a>"</td>"</tr>"</table>"<br>"<Br>";
}
echo""</ul>"</div>";

?>

If it weren't for the XML we could do this entirely off the shelf and in one morning/afternoon, however if we wait long enough, we could do that off the shelf too, if given enough time . . . I'll be working with sql on top of xml soon enough in my own job.

Regards,
Justin

Log in or register to post.

The whole thread (40 posts)