Skip to content

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

Open
@ngigiwaithaka

Description

@ngigiwaithaka

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