Added search index table + simple XML-based search interface
The XML thing is supposed to be used for auto-completion, of course. The current search implementation is very, very stupid and simple: Just a prefix match on the man name, and simple detection of section stuff. I suppose it'll suffice for now.
This commit is contained in:
parent
5d39a55158
commit
10e8d4acae
4 changed files with 38 additions and 21 deletions
9
util/update_indices.sql
Normal file
9
util/update_indices.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-- Create a new table before replacing in order to avoid a long-held lock on
|
||||
-- the table being replaced. The site should remain responsive while these
|
||||
-- queries are run.
|
||||
BEGIN;
|
||||
CREATE TABLE man_index_new AS SELECT DISTINCT name, section FROM man;
|
||||
CREATE INDEX ON man_index_new USING btree(lower(name) text_pattern_ops);
|
||||
DROP TABLE man_index;
|
||||
ALTER TABLE man_index_new RENAME TO man_index;
|
||||
COMMIT;
|
||||
Loading…
Add table
Add a link
Reference in a new issue