From 0e0b1120fba8ed4f2ebc5d62eb29b1a34c1b1007 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 11 Jan 2006 18:56:07 +0000 Subject: - overhauled search system - updated structure for search backend plugins - better result caching using ACM - search results no longer session restricted => link to them by copying the URL :) - in-topic search - indexing posts now uses search backend plugins - develop/search_fill.php working again - fulltext_mysql not working yet - tiny bugfixes to ACM git-svn-id: file:///svn/phpbb/trunk@5441 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/firebird_schema.sql | 13 ++++--------- phpBB/install/schemas/mssql_schema.sql | 12 ++++-------- phpBB/install/schemas/mysql_schema.sql | 17 ++++++++--------- phpBB/install/schemas/oracle_schema.sql | 11 ++++------- phpBB/install/schemas/postgres_schema.sql | 11 ++++------- phpBB/install/schemas/schema_data.sql | 8 ++++++-- 6 files changed, 30 insertions(+), 42 deletions(-) (limited to 'phpBB/install/schemas') diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 74d8c64965..91f23238cd 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -481,10 +481,10 @@ CREATE TABLE phpbb_reports_reasons ( # phpbb_search_results CREATE TABLE phpbb_search_results ( - search_id INTEGER DEFAULT 0 NOT NULL, - session_id VARCHAR(32) NOT NULL, + search_key VARCHAR(32) NOT NULL, search_time INTEGER DEFAULT 0 NOT NULL, - search_array BLOB SUB_TYPE TEXT NOT NULL + search_keywords BLOB SUB_TYPE TEXT NOT NULL, + search_authors BLOB SUB_TYPE TEXT NOT NULL );; # phpbb_search_wordlist @@ -1242,12 +1242,7 @@ ADD PRIMARY KEY ( ALTER TABLE phpbb_search_results ADD PRIMARY KEY ( - search_id -);; - -CREATE INDEX session_id54 -ON phpbb_search_results( - session_id + search_key );; ALTER TABLE phpbb_search_wordlist diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 9a877e785c..2065f86f43 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -486,10 +486,10 @@ CREATE TABLE [phpbb_reports_reasons] ( GO CREATE TABLE [phpbb_search_results] ( - [search_id] [int] NOT NULL , - [session_id] [varchar] (32) NOT NULL , + [search_key] [varchar] (32) NOT NULL , [search_time] [int] NOT NULL , - [search_array] [text] NOT NULL + [search_keywords] [text] NOT NULL , + [search_authors] [text] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -1058,7 +1058,7 @@ GO ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD CONSTRAINT [PK_phpbb_search_results] PRIMARY KEY CLUSTERED ( - [search_id] + [search_key] ) ON [PRIMARY] GO @@ -1461,7 +1461,6 @@ ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD GO ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD - CONSTRAINT [DF_search_search_id] DEFAULT (0) FOR [search_id], CONSTRAINT [DF_search_search_time] DEFAULT (0) FOR [search_time] GO @@ -1785,9 +1784,6 @@ GO CREATE INDEX [field_order] ON [phpbb_profile_fields]([field_order]) ON [PRIMARY] GO -CREATE INDEX [session_id] ON [phpbb_search_results]([session_id]) ON [PRIMARY] -GO - CREATE INDEX [word_id] ON [phpbb_search_wordlist]([word_id]) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 13c914ff51..eb60923afc 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -563,17 +563,16 @@ CREATE TABLE phpbb_reports ( PRIMARY KEY (report_id) ); -# Table: phpbb_search_results -CREATE TABLE phpbb_search_results ( - search_id int(11) UNSIGNED DEFAULT '0' NOT NULL, - session_id varchar(32) DEFAULT '' NOT NULL, +# Table: 'phpbb_search_results' +CREATE TABLE new_search_results ( + search_key varchar(32) DEFAULT '' NOT NULL, search_time int(11) DEFAULT '0' NOT NULL, - search_array mediumtext NOT NULL, - PRIMARY KEY (search_id), - KEY session_id (session_id) + search_keywords mediumtext NOT NULL, + search_authors mediumtext NOT NULL, + PRIMARY KEY (search_key) ); -# Table: phpbb_search_wordlist +# Table: 'phpbb_search_wordlist' CREATE TABLE phpbb_search_wordlist ( word_text varchar(50) BINARY DEFAULT '' NOT NULL, word_id mediumint(8) UNSIGNED NOT NULL auto_increment, @@ -582,7 +581,7 @@ CREATE TABLE phpbb_search_wordlist ( KEY word_id (word_id) ); -# Table: phpbb_search_wordmatch +# Table: 'phpbb_search_wordmatch' CREATE TABLE phpbb_search_wordmatch ( post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 791ede23bd..eb076921d9 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1141,17 +1141,14 @@ END; Table: phpbb_search_results */ CREATE TABLE phpbb_search_results ( - search_id number(11) DEFAULT '0' NOT NULL, - session_id varchar2(32) DEFAULT '', + session_key varchar2(32) DEFAULT '', search_time number(11) DEFAULT '0' NOT NULL, - search_array clob, - CONSTRAINT pk_phpbb_search_results PRIMARY KEY (search_id) + search_keywords clob, + search_authors clob, + CONSTRAINT pk_phpbb_search_results PRIMARY KEY (search_key) ) / -CREATE INDEX session_id on phpbb_search_results (session_id) -/ - /* Table: phpbb_search_wordlist */ diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 98c335644f..e840387efe 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -775,16 +775,13 @@ SELECT SETVAL('phpbb_reports_report_id_seq',(select case when max(report_id)>0 t /* Table: phpbb_search_results */ CREATE TABLE phpbb_search_results ( - search_id INT4 DEFAULT '0' NOT NULL, - session_id varchar(32) DEFAULT '' NOT NULL, + search_key varchar(32) DEFAULT '' NOT NULL, search_time INT4 DEFAULT '0' NOT NULL, - search_array TEXT DEFAULT '' NOT NULL, - PRIMARY KEY (search_id), - CHECK (search_id>=0) + search_keywords TEXT DEFAULT '' NOT NULL, + search_authors TEXT DEFAULT '' NOT NULL, + PRIMARY KEY (search_key) ); -CREATE INDEX session_id_phpbb_search_results_index ON phpbb_search_results (session_id); - /* Table: phpbb_search_wordlist */ CREATE SEQUENCE phpbb_search_wordlist_word_i; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index af64f7dbb7..b890e470a4 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -108,6 +108,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', '') INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1'); @@ -121,7 +122,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1') INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search_phr', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search_upd', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); @@ -138,12 +138,13 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_smilies', INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_urls', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_quote_depth', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_reg_attempts', '5'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_search_chars', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_search_chars', '14'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars', '255'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_chars', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0'); @@ -156,9 +157,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'imag INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('save_passwd', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', 'fulltext_phpbb'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_downloads', '0'); @@ -184,6 +187,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '2.1.2') INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cache_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('database_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('last_queue_run', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('last_search_time', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_id', '2', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_username', '', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_files', '0', 1); -- cgit v1.2.1