querying both text and non-text properties

From: Rob Nikander <rob(dot)nikander(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: querying both text and non-text properties
Date: 2018-12-04 20:57:06
Message-ID: BE65D660-2C05-47A3-8A0B-6D33DDE71826@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Mueller 2018-12-04 20:57:25 Re: simple division
Previous Message David G. Johnston 2018-12-04 20:45:02 Re: simple division