Progressively Relaxed Query with AND (&) Operator works on 11.1.0.7 but Fails with DRG-50962 on 11gR2 (Doc ID 1312422.1)

Last updated on APRIL 11, 2011

Applies to:

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

Symptoms

A Oracle Text search using query rewrite template with token "&" character causes the query to fail in 11gR2 with below errors whereas the same query works fine in 11.1.0.7.

create table test(case_id number primary key, text varchar2(50));

set define off

insert into test values(1, 'Test text for service request.');
insert into test values(2, 'Text contains &test % | - special chars.');
insert into test values(3, 'Summary text');
commit;

select * from test;

   CASE_ID TEXT
---------- --------------------------------------------------
         1 Test text for service request.
         2 Text contains &test % | - special chars.
         3 Summary text

create index test_idx on test(text) indextype is ctxsys.context;

SELECT score(0) score, case_id, text
from test
where contains(Text, '
<query>
<textquery lang="ENGLISH" grammar="CONTEXT">contain test&
<progression>
<seq><rewrite>transform((TOKENS, "{", "}", " OR "))</rewrite></seq>
</progression>
</textquery>
<score datatype="INTEGER" algorithm="COUNT"/>
</query>
', 0) > 0
ORDER BY SCORE(0) desc;

SELECT score(0) score, case_id, text
*
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-50962: Query operators are not allowed in transform input string

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