Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RUM Index WITH rum_tsvector_addon_ops does not work for jsonb columns #58

Open
@ngigiwaithaka

Description

Suppose you have this table

CREATE TABLE articles (id int, object_data JSONB);

If object_data has two fields (article & timeCreatedAsFromServer)

The following returns the error
ERROR: attribute "((object_data -> 'timeCreatedAsFromServer')::bigint)" is not found in table

CREATE INDEX article_rum_idx ON articles
 USING rum (to_tsvector('English', object_data->>'article') rum_tsvector_addon_ops,	 ((object_data -> 'timeCreatedAsFromServer')::bigint))
 WITH (attach = '((object_data -> ''timeCreatedAsFromServer'')::bigint)', to = 'to_tsvector(''English'', object_data->>''article'')')

If you omit the WITH clause, it works as below!

CREATE INDEX article_rum_idx ON articles
 USING rum (to_tsvector('English', object_data->>'article') rum_tsvector_addon_ops,	 ((object_data -> 'timeCreatedAsFromServer')::bigint))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /