[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [xml] Search engine is complete
- From: Sean Chittenden <sean chittenden org>
- To: Daniel Veillard <veillard redhat com>
- Cc: xml gnome org
- Subject: Re: [xml] Search engine is complete
- Date: Tue, 8 Oct 2002 16:03:52 -0700
> > > > http://xmlsoft.org/search.php
> > > >
> > > > except the XSLT stuff is not yet indexed, it should have a proper
> > > > index for:
> > > > - the libxml2 API
> > > > - the Web pages on the site
> > > > - the mailing list archives
> >
> > Send a patch to the HTML and I will try to do the server side stuff.
>
> Oh, another thing I would appreciate help on is the cache problem,
> basically it seems PHP pages aren't cached, which mean when one
> follows a link result of the search and go back in the browser the
> request is sent back and not cached. I assume it should be possible
> from the PHP code to avoid this effect by sending proxy cache
> headers but someone probably knows how to avoid this already ...
I used PHP in a former life and vowed I'd never touch it
again... since then, PHP has successfully left the building so I'm not
sure how to turn on caching. Someone else here likely knows. The
following is some pseudo code that I think you should be able to
follow. -sc
--
Sean Chittenden
Index: search.php
===================================================================
RCS file: /cvs/gnome/gnome-xml/doc/search.php,v
retrieving revision 1.9
diff -u -r1.9 search.php
--- search.php 8 Oct 2002 17:30:30 -0000 1.9
+++ search.php 8 Oct 2002 23:02:29 -0000
@@ -100,6 +100,15 @@
<form action="<?php echo "$PHP_SELF", "?query=", rawurlencode($query) ?>"
enctype="application/x-www-form-urlencoded" method="GET">
<input name="query" type="TEXT" size="50" value="<?php echo $query?>">
+ <select name="type">
+ <option value="any">Search All</option>
+ <%
+sql = 'SELECT symbols.module FROM symbols GROUP BY symbols.module'
+dbh.select_all(sql) do |row|
+ print "<option value=\"#{row[0]}\">#{row[0]}</option>"
+end
+%>
+ </select>
<input name=submit type=submit value="Search ...">
</form>
<?php
@@ -124,7 +133,11 @@
$result = NULL;
$j = 0;
if ($word) {
- $result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75");
+ if ($module and $module != 'any') {
+ $result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and symbols.module = '$module' and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75");
+ } else {
+ $result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75");
+ }
if ($result) {
$j = mysql_num_rows($result);
if ($j == 0)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]