Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUHko-0003rf-Nq for pgsql-general@arkaria.postgresql.org; Tue, 04 Dec 2018 20:57:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUHkn-0007u3-GR for pgsql-general@arkaria.postgresql.org; Tue, 04 Dec 2018 20:57:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUHkn-0007tw-3A for pgsql-general@lists.postgresql.org; Tue, 04 Dec 2018 20:57:13 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUHkk-0000QM-FN for pgsql-general@postgresql.org; Tue, 04 Dec 2018 20:57:11 +0000 Received: by mail-oi1-x233.google.com with SMTP id a77so15553536oii.5 for ; Tue, 04 Dec 2018 12:57:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=LG0/LXtWLieZ5D9zfG8el06qcUejdRyLoJSnRWIrx1k=; b=JSpf14ddsSSng+IsTeXxensYpZ8WKh46/xLfpBxuosnSbobMoFoFgfyI0Exuibfl9P IF/2BA9bK7IAi5YXpMRFiRTXvMPMYZvGxG69hsg1bMPiwe0Oy0e0M+xKsdtS4Fzd7Cfc anwWDh2txyKnnRh/5UWCOTuM1SvQk4HvuVjJVWtBvny7a4cbjdl5sxOvATXO4rhqHJIK TZ+qFWpANAIPtvsLoZoYUEeMsQetAR0fpu+ucAS/DG3OkVUKOItuckc8XWWGOU5x8iA5 6AoVHP4wlwGTQXcE+2Qyi9YusyoaBhklnv3X9Z2GxR7/nmbBkPJLIoBpXgwFzEHsaQVw gCaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=LG0/LXtWLieZ5D9zfG8el06qcUejdRyLoJSnRWIrx1k=; b=ntHdNDy90rtqCwxrchjjyq/cDpxk9D+Vjv4C7BB5+mofOSIgsi060Cajvt0Be4CuWW T0j+IdmssBYzaobZGLkzLrCbDpCpFSsjgxTq+IdJMppfrxqht4g7N/QDUoyM7Ub0BaUb 2ePSNXwFR9ptGdTENqWOG1gmEZg9plWt9WcT0wHj4WOoo8Mosco9EWxI/4ZODF4gabvS kCiVeLCCo1JY0m3d+boY81iJqMZpT3PuOFZs9mPyfZNxWYGtnV4sBFODIdvhYifpi7aW f6LcRt2x/a0YFc609mUxcvzt1zLGyHF6fvw+CoKz1vrzaO4EwvggEgg+yATifnmwXhNq GuBw== X-Gm-Message-State: AA+aEWbQYuI1yJ52359pprbWC8vjawnZV5H/I+q+/BxWfq5cFKfR6pLY jDmHySSqVBUJZLA/yhC2gNzVf9M3 X-Google-Smtp-Source: AFSGD/W7cB189Hc4DWhzy2WqYvTu9DVsEO8vNP02xNE2oyPQWST+Cal1HaLnlBWN1fXdl2Lsu/VhTw== X-Received: by 2002:aca:a60d:: with SMTP id p13mr13884116oie.2.1543957029310; Tue, 04 Dec 2018 12:57:09 -0800 (PST) Received: from [192.168.1.65] ([187.147.244.237]) by smtp.gmail.com with ESMTPSA id s66sm18632468oia.55.2018.12.04.12.57.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 12:57:08 -0800 (PST) From: Rob Nikander Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: querying both text and non-text properties Message-Id: Date: Tue, 4 Dec 2018 15:57:06 -0500 To: Postgres General X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi,=20 I=E2=80=99ve got an application where I=E2=80=99d like to search a = collection of objects based on various properties, some text and others = non-text (bools, enums, ints, etc). I=E2=80=99ve used full text search = before, following the PG docs to set up a index on a ts_vector. And of = course I=E2=80=99ve 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 = =3D red, I can imagine putting the color property into the text index = somehow - maybe with tokens like: =E2=80=99color_red=E2=80=99, = =E2=80=98color_blue=E2=80=99, but for something like an integer =E2=80=A6 = ? Rob=