如何在 Informix 中创建 BTS 索引

How to create BTS index in Informix

我在 Informix 中创建 BTS(基本文本搜索)索引时遇到问题。我创建了 test table 和 sbspace 来存储索引信息,就像在文档中一样。现在我的 sbspace 看起来像:

[informix@test-informix informix]$ onspaces -c -S bts_sbspace -p  /home/informix/chunks/bts_sbspace -o 0 -s 1500000 -Df "LOGGING=ON"
...
[informix@test-informix informix]$ onstat -d | grep SB
ed682820         7        0x68001    7        3        2048     N SB     informix sbspace
fd409e00         14       0x68001    73       1        2048     N SB     informix bts_sbspace
ed8c1028         7      7      0          50000      43896      44061      POSBD /home/informix/IFMXDATA/ol_testifx/sbspacedbs.000
edb82db8         30     7      0          500000     466235     466319     POSBD /home/informix/IFMXDATA/ol_testifx/sbspacedbs.001
ee7fe028         31     7      0          500000     466306     466319     POSBD /home/informix/IFMXDATA/ol_testifx/sbspacedbs.002
fd40de00         73     14     0          750000     699446     699446     POSBD /home/informix/chunks/bts_sbspace

但是当我想创建索引时:

CREATE INDEX lab1_bts_index ON lab1(text_data bts_lvarchar_ops) USING BTS IN bts_sbspace;

它以错误结束:

Error: bts internal error.  File c/bts_am_extspace.c, line 505
SQLState:  BTS02
ErrorCode: -937
Position: 88

我使用 IBM Informix Dynamic Server Version 11.50.FC4bts2.0 注册测试数据库。

如何创建BTS索引?

您的示例在我的 11.50uc7 上运行良好,但具有不同的 table 架构。 可能是你遇到了错误 IC81229。

onmode -p +1 bts
echo "register bts.2.00 stores"|blademgr
onspaces -c -S bts_sbspace -p  /home/informix/ids1150uc7/bts_sbspace -o 0 -s 2000 -Df "LOGGING=ON"
create table tclob (id integer,c  clob);
create index ixclob on tclob (c bts_clob_ops) using bts in bts_sbspace