Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a1715ac8
Commit
a1715ac8
authored
Nov 14, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust example to reduce confusion between a tsvector column and
an index, per Simon.
parent
866bad95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
doc/src/sgml/textsearch.sgml
doc/src/sgml/textsearch.sgml
+5
-5
No files found.
doc/src/sgml/textsearch.sgml
View file @
a1715ac8
<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.3
4 2007/11/14 23:43:27
tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.3
5 2007/11/14 23:48:55
tgl Exp $ -->
<chapter id="textsearch">
<chapter id="textsearch">
<title id="textsearch-title">Full Text Search</title>
<title id="textsearch-title">Full Text Search</title>
...
@@ -538,15 +538,15 @@ CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', title || body))
...
@@ -538,15 +538,15 @@ CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', title || body))
indexed when the other is <literal>NULL</>:
indexed when the other is <literal>NULL</>:
<programlisting>
<programlisting>
ALTER TABLE pgweb ADD COLUMN textsearch
_index
tsvector;
ALTER TABLE pgweb ADD COLUMN textsearch
able_index_col
tsvector;
UPDATE pgweb SET textsearch
_index
=
UPDATE pgweb SET textsearch
able_index_col
=
to_tsvector('english', coalesce(title,'') || coalesce(body,''));
to_tsvector('english', coalesce(title,'') || coalesce(body,''));
</programlisting>
</programlisting>
Then we create a <acronym>GIN</acronym> index to speed up the search:
Then we create a <acronym>GIN</acronym> index to speed up the search:
<programlisting>
<programlisting>
CREATE INDEX textsearch_idx ON pgweb USING gin(textsearch
_index
);
CREATE INDEX textsearch_idx ON pgweb USING gin(textsearch
able_index_col
);
</programlisting>
</programlisting>
Now we are ready to perform a fast full text search:
Now we are ready to perform a fast full text search:
...
@@ -554,7 +554,7 @@ CREATE INDEX textsearch_idx ON pgweb USING gin(textsearch_index);
...
@@ -554,7 +554,7 @@ CREATE INDEX textsearch_idx ON pgweb USING gin(textsearch_index);
<programlisting>
<programlisting>
SELECT title
SELECT title
FROM pgweb
FROM pgweb
WHERE t
o_tsquery('create & table') @@ textsearch_index
WHERE t
extsearchable_index_col @@ to_tsquery('create & table')
ORDER BY last_mod_date DESC LIMIT 10;
ORDER BY last_mod_date DESC LIMIT 10;
</programlisting>
</programlisting>
</para>
</para>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment