Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

"+" special character problem with SYN operator

MuzyDec 12 2019 — edited Jan 3 2020

Hi,

i wanted to crete a synonym for "ABC+" and "ABCPLUS". To achieve this i had to escape the "+" character with curly braces like this :

exec ctx_thes.create_relation('TEST_SYN', '{ABC+}', 'SYN', 'ABCPLUS');

When i run this query, i can see the synonym phrases "ABC+" and "ABCPLUS" :

SELECT * FROM ctx_thes_phrases where thp_phrase like 'ABC%';

But when i query it with SYN function ( that is also used in CONTAINS queries i think ), i don't get expected result.

select CTX_THES.SYN('{ABC+}', 'TEST_SYN') from dual;

Actual Result:

({ABC}&{}) | {ABCPLUS}

Expected Result:

{ABC+} | {ABCPLUS}

Because of this my contains query doesn't give me expected results. It seems that the SYN function evaluates "+" character as & (AND) operator.

To search within a domain index, i have also configure the domain index like this.

ctx_ddl.set_attribute(preference_name => 'LEXER_NAME', attribute_nameĀ  => 'printjoins', attribute_value => '+');

As a result, when i search for "ABC+" with synonyms, i get results with "ABC", because of the result of the SYN function : ({ABC}&{}) | {ABCPLUS}. And i don't want this.

select * from test_table

where CONTAINS(full_index,'SYN({ABC+},TEST_SYN)',0)>0;

Any ideas ?

Thanks.

Comments
Post Details
Added on Dec 12 2019
2 comments
340 views