From: Rob Nikander <rob.nikander@gmail.com>
To: Postgres General <pgsql-general@postgresql.org>
Subject: querying both text and non-text properties
Date: Tue, 4 Dec 2018 15:57:06 -0500
Message-ID: <BE65D660-2C05-47A3-8A0B-6D33DDE71826@gmail.com> (raw)
Hi,
I’ve got an application where I’d like to search a collection of objects based on various properties, some text and others non-text (bools, enums, ints, etc). I’ve used full text search before, following the PG docs to set up a index on a ts_vector. And of course I’ve used normal indexes before for accelerating basic queries that use non-text columns.
Any recommendations on combining the two? For example, if I search for objects where the description text matches [some ts_query] and the color = red, I can imagine putting the color property into the text index somehow - maybe with tokens like: ’color_red’, ‘color_blue’, but for something like an integer … ?
Rob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: rob.nikander@gmail.com
Subject: Re: querying both text and non-text properties
In-Reply-To: <BE65D660-2C05-47A3-8A0B-6D33DDE71826@gmail.com>
References: <BE65D660-2C05-47A3-8A0B-6D33DDE71826@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox