To remove a specific page from the database execute two SQL statements
using the -s
option. First delete the record from the
html table, then delete all related records from the references
table. For example; to remove the page http://www.mysite.com/junk.html
use the following commands:
gw -s "delete from html where Url='www.mysite.com/junk.html'"
gw -s "delete from refs where Url='www.mysite.com/junk.html'
Note the missing http://
prefix. It is not stored in the
database.
You may wish to perform a ``select'' before a ``delete'' to see
what you are going to delete before committing to it. Using
the above example; use the following command to find the title
of the document you are about to delete:
gw -s "select Url,Title from html
where Url='www.mysite.com/junk.html'"
To remove a group of related pages from the database use a REX Regular
Expression to specify the substring or pattern common to all of the
pages you want to delete. Precede the substring or expression with
slash ('/'). To delete all pages under the /testdir
tree use the following commands:
gw -s "delete from html where Url like '/www.mysite.com/testdir'"
gw -s "delete from refs where Url like '/www.mysite.com/testdir'"
gw -index
The like
means search the field for the argument. The leading
slash (/
) means do a regular expression match. This will delete
every record whose Url contains the substring ``www.mysite.com/testdir''. See
the query construction documentation at
http://www.thunderstone.com/webinator/
for help building ``like'' statements. Also remember to run with the
-index
option to update the indices after deleting numerous pages
to speed up searches.