Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

PostgreSQL can search natural-language content without a separate search service. On a Linux VPS, the production-ready pattern is a fixed text-search configuration, a stored tsvector column, and a GIN index; convert search-box input with websearch_to_tsquery, rank matches with ts_rank_cd, and generate snippets with ts_headline.

What PostgreSQL full-text search does

PostgreSQL full-text search (FTS) is built into the database. It represents a document with the tsvector type and a user query with the tsquery type. A vector is a sorted set of normalized lexemes rather than the original words. Normalization can include lowercasing, stop-word removal, stemming, positions, and field weights. A query is an expression that can require terms, match alternatives, exclude terms, or enforce phrase relationships.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The match operator is @@. A typical comparison is:

SELECT to_tsvector('english', 'The Fat Rats');

SELECT websearch_to_tsquery('english', '"fat rat" or cat -dog');

SELECT to_tsvector('english', 'The Fat Rats')
       @@ websearch_to_tsquery('english', 'fat rat');

The first expression creates the document representation; the second creates a safe, web-style query; the third returns whether the document matches. PostgreSQL documentation from the Global Development Group describes these two types as the foundation for searching collections of natural-language documents.

FTS is not the same as a substring search. A condition such as title ILIKE '%cat%' looks for characters and normally cannot use a text-search index. FTS works with words and lexemes, supports relevance ranking, and can return highlighted excerpts.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

When native PostgreSQL search is the right choice

Keep search inside PostgreSQL when the documents already live there, SQL filters and joins are important, and operating one system is preferable to synchronizing a second index. The database can filter by tenant, permissions, publication state, category, or date in the same query that performs FTS.

Evaluate a separate search engine when you need extensive typo or fuzzy matching, specialized language analyzers, very large distributed corpora, cross-node search scaling, or advanced relevance controls that exceed PostgreSQL’s facilities. PostgreSQL’s official documentation does not establish a universal response-time figure. Measure your own corpus and VPS workload before promising latency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare and secure PostgreSQL on the VPS

Package names and service commands differ by Linux distribution and PostgreSQL major version. Verify the installed major version and use your distribution’s supported repository or the PostgreSQL project’s repository. The following is a Debian or Ubuntu-style example:

sudo apt update
sudo apt install postgresql postgresql-client
sudo systemctl enable --now postgresql
psql --version

On a Red Hat-family distribution, the equivalent packages are commonly installed with dnf, but the exact package stream and service name depend on the repository. Do not copy a command across distributions without checking the package documentation.

Create an application database and a role with only the privileges it needs. Run administrative statements as the PostgreSQL administrator, then use the application role for normal connections:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
sudo -u postgres psql

CREATE ROLE app_user LOGIN PASSWORD 'use-a-secret-from-your-secret-store';
CREATE DATABASE app_db OWNER app_user;
c app_db
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
GRANT USAGE, CREATE ON SCHEMA public TO app_user;

Restrict network exposure with the VPS firewall. In pg_hba.conf, allow only the application network or host and require an appropriate authentication method; avoid a broad rule that permits every address. Reload PostgreSQL after changing access rules, and use TLS when traffic leaves the local machine or a trusted private network. Store credentials outside source code and rotate them according to your deployment policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose and record the text-search configuration

The configuration determines tokenization, stop words, dictionaries, and stemming. It is part of your data model, not a cosmetic query option.

Configuration Typical use Important behavior
english English prose and articles Applies English stop-word and stemming rules, so related forms can share a lexeme.
simple Exact token normalization or mixed content Does not apply language stemming; useful when changing a word to its stem would be undesirable.
Other installed language configurations Corpora written in another supported language Use a configuration that matches the corpus and verify its dictionaries and stop words.

Record the selected configuration in schema or deployment configuration. Changing it changes the lexemes stored in vectors, so existing indexes must be rebuilt after an intentional change. A multilingual application may need separate vectors or a carefully designed configuration strategy rather than silently switching languages per request.

Create a stored search vector

Keep the original title and body in ordinary columns and add a stored generated column. The expression below gives titles weight A and bodies weight D. It also uses coalesce so a nullable body cannot turn the entire concatenation into NULL.

CREATE TABLE articles (
  id            bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  title         text NOT NULL,
  body          text,
  published_at  timestamptz NOT NULL DEFAULT now(),
  search_vector tsvector GENERATED ALWAYS AS (
    setweight(to_tsvector('english', coalesce(title, '')), 'A') ||
    setweight(to_tsvector('english', coalesce(body,  '')), 'D')
  ) STORED
);

The generated value is recalculated whenever its source columns change, so application code does not need a trigger to keep the vector synchronized. Positions in the vector preserve where lexemes occurred; weights preserve the title-versus-body distinction for ranking. If you add tags, an author field, or another searchable column, normalize each nullable value with coalesce and assign a weight that reflects its importance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Generated columns are convenient for a stable schema. If your application needs a custom dictionary, language per row, or preprocessing that cannot be expressed in the generated expression, maintain a regular tsvector column with a controlled trigger or application write path and test that path thoroughly.

Add the GIN index

GIN (Generalized Inverted Index) is PostgreSQL’s preferred index type for frequently searched tsvector values. It maps lexemes to the rows containing them, avoiding a full table scan for selective terms.

CREATE INDEX articles_search_vector_gin
  ON articles USING GIN (search_vector);

Run this after the table exists and before production traffic depends on the search path. On a large table, index creation can consume substantial I/O, memory, and write capacity. Schedule it during a maintenance window, or evaluate CREATE INDEX CONCURRENTLY if your deployment policy permits the longer, lower-blocking build. Concurrent creation has its own failure and cleanup considerations, so monitor the build rather than assuming it completed.

Convert user input with the right query function

Different query constructors have different safety and semantics. Treat text entered in a search box as data and bind it as a parameter.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
User intent Function Behavior
Search-box text with quoted phrases, or, and exclusions websearch_to_tsquery Accepts web-search-like syntax, including quoted phrases, or, and a dash for NOT, without requiring users to know PostgreSQL operators.
Plain text where every non-stopword should be required plainto_tsquery Converts ordinary text into an AND query and treats punctuation as text rather than operator syntax.
An exact phrase or ordered phrase intent phraseto_tsquery Builds phrase and distance operators so word order and adjacency matter.
Trusted administrative syntax to_tsquery Provides full operator control, but the input must contain valid PostgreSQL tsquery operators and should never be assembled from untrusted text.

websearch_to_tsquery is the normal default for a public search form. to_tsquery is appropriate only when a trusted administrator or a controlled application component intentionally supplies syntax such as cat & (dog | mouse) & !rat. Bind the input through your driver instead of concatenating it into SQL.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Run a ranked, highlighted search

The following query parses the input once, filters through the GIN index, computes cover-density relevance, and produces up to two highlighted fragments:

SELECT a.id,
       a.title,
       a.published_at,
       ts_rank_cd(a.search_vector, q) AS relevance,
       ts_headline(
         'english',
         a.body,
         q,
         'StartSel=<mark>,StopSel=</mark>,MaxFragments=2'
       ) AS snippet
FROM articles AS a,
     websearch_to_tsquery('english', :search_text) AS q
WHERE a.search_vector @@ q
ORDER BY relevance DESC, a.published_at DESC, a.id DESC
LIMIT 20;

Use a deterministic secondary sort, such as publication date and ID, after relevance. Ranking is a signal produced by term frequency, positions, weights, and the selected ranking algorithm; it is not an objective guarantee that the first row is the best result. ts_rank scores frequency and weights, while ts_rank_cd also considers cover density, which rewards query terms appearing near one another.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The title receives weight A and the body receives D in the schema above. When the defaults are not appropriate, pass a weight array to ts_rank or ts_rank_cd to define the relative contribution of weights A through D. Keep the weighting policy stable so changes in result order are explainable.

ts_headline generates an excerpt from the original text and marks matches. Configure its options to fit your front end, and escape the returned HTML appropriately for your rendering context. If a body can be null, decide whether to pass coalesce(a.body, '') or omit the snippet; do not let a null value break the result row.

Handle an empty or all-stopword input before running the query. A search form can reject blank text, display a prompt, or return an unfiltered page according to your product rules. Never interpret an empty query as permission to return every row accidentally.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use an expression index when a stored column is unnecessary

For a small schema, an expression index can index the normalized expression directly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
CREATE INDEX articles_fts_expr_gin
  ON articles USING GIN (
    to_tsvector('english', coalesce(title, '') || ' ' || coalesce(body, ''))
  );

SELECT id, title
FROM articles
WHERE to_tsvector('english', coalesce(title, '') || ' ' || coalesce(body, ''))
      @@ websearch_to_tsquery('english', :search_text);

The explicit configuration name is deliberate. PostgreSQL requires a fixed configuration in a to_tsvector expression index, and the query expression must use the same configuration for the planner to consider that index. An expression index saves a stored column but repeats the expression in queries and offers less visibility into the indexed representation. A generated column is usually easier to inspect, rank, and extend in a production application.

GIN versus GiST

GiST also supports tsvector and tsquery, but its signature representation is lossy. A lossy match can produce false candidates that PostgreSQL must recheck against the table. Increasing GiST’s siglen improves precision at the cost of a larger index. For the normal application search column, choose GIN unless a measured workload gives GiST a specific advantage, such as a different indexing mix or space trade-off.

Operate and tune FTS on a VPS

Verify the actual plan

Test representative queries, not only a tiny development table:

EXPLAIN (ANALYZE, BUFFERS)
SELECT id
FROM articles
WHERE search_vector @@ websearch_to_tsquery('english', 'database backup');

Check whether the GIN index is considered, how many rows are rechecked, how much data is read, and whether later SQL filters dominate the cost. A sequential scan is not automatically wrong for a very small table or an extremely common term; compare plans at realistic table sizes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep statistics and vacuum healthy

Run ANALYZE after bulk loads so the planner has current statistics. Monitor table and index growth, write amplification, autovacuum activity, and dead tuples. FTS indexes are updated when source text changes, so high-frequency edits can create substantial write work even when searches are fast.

Plan rebuilds and configuration changes

Record the PostgreSQL major version, Linux distribution, locale, dictionaries, and text-search configuration in deployment records. If you intentionally change a dictionary, stop-word list, stemming behavior, or configuration, rebuild the affected generated data or index and validate result changes before releasing it. A normal REINDEX repairs index storage; it does not by itself change the lexemes produced by a different configuration unless the indexed expression is rebuilt with that configuration.

Measure freshness requirements

A stored generated vector is updated in the same row write, which gives transactional freshness. Bulk imports still need an indexing and statistics plan, and a large index build may compete with application traffic. If near-real-time ingestion is required, measure commit, indexing, and query behavior on the target VPS rather than relying on a generic claim.

Common failure modes and fixes

  • The index is not used. Confirm that the query uses the same configuration and expression as the index, that the predicate is written with @@, and that table statistics are current. Inspect the plan with EXPLAIN (ANALYZE, BUFFERS).
  • Rows disappear when body is null. Normalize nullable fields with coalesce(body, '') before concatenation or vectorization.
  • Search terms do not match expected word forms. Check whether english stemming or stop words removed the term. Try simple for exact token normalization, or choose a configuration suited to the corpus.
  • A phrase search behaves like separate terms. Use phraseto_tsquery or quoted input through websearch_to_tsquery instead of plainto_tsquery.
  • Untrusted input causes syntax errors. Stop sending raw text to to_tsquery. Bind the value and use websearch_to_tsquery for user-entered searches.
  • Highlighting is unsafe or malformed. Treat ts_headline output as generated markup only after applying the escaping and sanitization policy required by your application.
  • Results change order between requests. Add a deterministic secondary and tertiary sort after the rank, such as timestamp and ID.
  • Index creation affects production writes. Schedule the build, watch disk and I/O usage, and assess CREATE INDEX CONCURRENTLY under your migration policy.
  • A configuration change produces stale matches. Rebuild the stored vectors or expression index with the new dictionaries and then run ANALYZE.

Production checklist

  1. Confirm the PostgreSQL major version and distribution-specific installation procedure.
  2. Apply firewall rules and restrictive pg_hba.conf entries before exposing the database.
  3. Create a least-privilege application role and keep credentials in a secret manager.
  4. Select one text-search configuration per indexed corpus and record it in deployment configuration.
  5. Use a generated stored tsvector with coalesce for nullable source fields, unless a controlled trigger design is required.
  6. Create a GIN index on the vector and verify it with an execution plan.
  7. Use websearch_to_tsquery for search-box input; reserve to_tsquery for trusted syntax.
  8. Rank with ts_rank or ts_rank_cd, apply field weights deliberately, and add deterministic tie-breakers.
  9. Generate snippets with ts_headline and sanitize output for the rendering context.
  10. Benchmark representative queries, monitor index growth and vacuum health, and rebuild after intentional dictionary or configuration changes.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.