How to implement the creation of a complex index into sopm-file?

Moderator: crythias

Locked
edi
Znuny newbie
Posts: 17
Joined: 20 Nov 2018, 16:10
Znuny Version: OTRS 4
Real Name: Eduard
Location: Russia
Contact:

How to implement the creation of a complex index into sopm-file?

Post by edi »

Hello,

I wrote a module TicketExtraData
For this module I ctreated a ticket_extra_data table with an extra_data field of type JSONB
Now I want to implement the creation of an index for this field in a sopm-file.
create index ticket_extra_data_gin ON "ticket_extra_data" USING GIN ( to_tsvector('russian', extra_data->>'address'));

To do this, I added a subsection to the <TableCreate Name = "ticket_extra_data"> section like this
<Index Name="ticket_extra_data_gin">
<IndexColumn Name="extra_data" Using="USING GIN ( to_tsvector('russian', extra_data->>'address' )" />
</Index>

But it doesn't work.
Instead, I got an index
CREATE INDEX ticket_extra_data_gin ON ticket_extra_data USING btree (extra_data)

database is PostgreSQL
root
Administrator
Posts: 4251
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: How to implement the creation of a complex index into sopm-file?

Post by root »

Hi,

Try using the DBObject with Do() in a package setup of your sopm


- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
edi
Znuny newbie
Posts: 17
Joined: 20 Nov 2018, 16:10
Znuny Version: OTRS 4
Real Name: Eduard
Location: Russia
Contact:

Re: How to implement the creation of a complex index into sopm-file?

Post by edi »

Thanks a lot!
It works!.
Locked