Greetings,
If we would like to add the capability of searching either the entire site
or certain subdirectories of the site, which method is preferable:
1) Create separate databases and pass the appropriate db value in the search
form
Example: Create separate databases:
gw -dALL http://www.mysite.com
gw -dSUB -jhttp://www.mysite.com/subdir
http://www.mysite.com
In search form, have something like:
<select name="db">
<option value="ALL">Entire Site</option>
<option value="SUB">Subdirectory
Only</option></select>
2) Use only one database and a MATCHES clause in the SQL statement
Example: Create one database:
gw http://www.mysite.com
In search form, have something like:
<INPUT TYPE=hidden NAME=db VALUE="db">
<select name="path">
<option value="www.mysite.com%">Entire Site</option>
<option value="www.mysite.com/subdir%">Subdirectory
Only</option></select>
In script, have something like:
<sql ... "select ... where Title\Meta\Body likep $q
and Url matches $path ...">
Are there performance issues that makes one better than the other (assuming
that either method would even work)?
Thanks.