my $table = $node->table;
my $talias = $node->table_alias;
- $from .= "\n\tJOIN (\n\t\tSELECT * /* facet */\n\t\t FROM $table\n\t\t WHERE value IN (" . join(",", map { $self->QueryParser->quote_value($_) } @{$node->values}) . ")".
+ $from .= "\n\tJOIN (\n\t\tSELECT * /* facet */\n\t\t FROM $table\n\t\t WHERE SUBSTRING(value,1,1024) IN (" . join(",", map { $self->QueryParser->quote_value($_) } @{$node->values}) . ")".
"\n\t\t\tAND field IN (SELECT id FROM config.metabib_field WHERE field_class = ". $self->QueryParser->quote_value($node->classname) ." AND facet_field";
if (@{$node->fields} > 0) {
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('title');
CREATE INDEX metabib_title_field_entry_index_vector_idx ON metabib.title_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_title_field_entry_value_idx ON metabib.title_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_title_field_entry_source_idx ON metabib.title_field_entry (source);
CREATE TABLE metabib.author_field_entry (
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('author');
CREATE INDEX metabib_author_field_entry_index_vector_idx ON metabib.author_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_author_field_entry_value_idx ON metabib.author_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_author_field_entry_source_idx ON metabib.author_field_entry (source);
CREATE TABLE metabib.subject_field_entry (
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('subject');
CREATE INDEX metabib_subject_field_entry_index_vector_idx ON metabib.subject_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_subject_field_entry_value_idx ON metabib.subject_field_entry (SUBSTRING(value,1,1024));
CREATE INDEX metabib_subject_field_entry_source_idx ON metabib.subject_field_entry (source);
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('keyword');
CREATE INDEX metabib_keyword_field_entry_index_vector_idx ON metabib.keyword_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_keyword_field_entry_value_idx ON metabib.keyword_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_keyword_field_entry_source_idx ON metabib.keyword_field_entry (source);
CREATE TABLE metabib.series_field_entry (
FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('series');
CREATE INDEX metabib_series_field_entry_index_vector_idx ON metabib.series_field_entry USING GIST (index_vector);
+CREATE INDEX metabib_series_field_entry_value_idx ON metabib.series_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_series_field_entry_source_idx ON metabib.series_field_entry (source);
CREATE TABLE metabib.rec_descriptor (
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0208');
+
+CREATE INDEX metabib_title_field_entry_value_idx ON metabib.title_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_author_field_entry_value_idx ON metabib.author_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_subject_field_entry_value_idx ON metabib.subject_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_keyword_field_entry_value_idx ON metabib.keyword_field_entry (SUBSTRING(value,1,1024));
+CREATE INDEX metabib_series_field_entry_value_idx ON metabib.series_field_entry (SUBSTRING(value,1,1024));
+
+CREATE INDEX metabib_author_field_entry_source_idx ON metabib.author_field_entry (source);
+CREATE INDEX metabib_keyword_field_entry_source_idx ON metabib.keyword_field_entry (source);
+CREATE INDEX metabib_title_field_entry_source_idx ON metabib.title_field_entry (source);
+CREATE INDEX metabib_series_field_entry_source_idx ON metabib.series_field_entry (source);
+
+COMMIT;
+