Text Query Using NOT (~) Operator in a Section Tag Could Fail with ORA-29903, ORA-20000 errors (Doc ID 1235023.1)

Last updated on JULY 20, 2011

Applies to:

Oracle Text - Version: 11.2.0.1 to 11.2.0.2 - Release: 11.2 to 11.2
Information in this document applies to any platform.

Symptoms

A CONTAINS query using the NOT(~) Operator to search in a SECTION GROUP fails in 11g with errors: ORA-29903, ORA-20000.

Sample test case:

drop table test;
CREATE TABLE test (id NUMBER, text VARCHAR2(50));
INSERT INTO test (id, text) VALUES (1, '<tag>number</tag>');
INSERT INTO test (id, text) VALUES (2, '<tag>number two</tag>');
INSERT INTO test (id, text) VALUES (3, '<tag>two</tag>');
COMMIT;

exec ctx_ddl.drop_section_group('auto');
exec ctx_ddl.create_section_group('auto', 'AUTO_SECTION_GROUP');

CREATE INDEX i_test_text ON test(text) INDEXTYPE IS ctxsys.context PARAMETERS('SECTION GROUP auto');

-- this query works
SELECT * FROM test WHERE contains(text, 'number WITHIN tag') > 0;

-- these queries fail with ORA-29903
SELECT * FROM test WHERE contains(text, '(number ~ (two)) WITHIN tag') > 0;
SELECT * FROM test WHERE contains(text, 'number NOT two WITHIN tag') > 0;

*
ERROR at line 1:
ORA-29903: error in executing ODCIIndexFetch() routine
ORA-20000: Oracle Text error:

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms