[schlenk] 2006-06-01: These two scripts provide a simple search facility for the wiki based on the [xapian] package. It could easily be extended into a website providing a better fulltext search for the Tcl'ers wiki. ---- '''The indexer''' #!/usr/bin/env tclsh # # Index the Tcl'ers Wiki # # (c) 2006 Michael Schlenker word]} { set i [lindex $word 0] set j [lindex $word 1] if {($j-$i) <= $::MAX_PROB_TERM_LENGTH} { set term [string range $text $i $j] set term [string tolower $term] set sterm [estem stem_word $term] log_debug "Indexing $term" $doc add_posting $term $pos incr pos $doc add_term $sterm } incr j } return $pos } proc openIndexDatabase {file} { xapian::WritableDatabase xapiandb $file $::xapian::DB_CREATE_OR_OVERWRITE xapian::Stem estem "english" return xapiandb } proc closeIndexDatabase {db} { $db -delete } indexWiki $wikifile ---- '''The simple command line searching utility''' #!/usr/bin/env tclsh # # Search the Wiki # # (c) 2006 Michael Schlenker