sqloracleoracle-text

Oracle text - contains search for 'and'


I am using Oracle 12c with text. I want to search for the word 'and' inside my section group. So I built the following query:

select distinct "Id" from "MyTable" where contains("Id", '((!and) within MYSECTIONGROUP)') > 0

This failed because of missing escape characters. So I changed it to:

select distinct "Id" from "MyTable" where contains("Id", '(({!and}) within MYSECTIONGROUP)') > 0

But I did not get any result (the entry has 'test and partner' in the specified column). If I search for 'and partner', I get the resulting column.

Any suggestions?


Solution

  • I found the issue: the exclamation mark was at the wrong position. The query must be:

    select distinct "Id" from "MyTable" where contains("Id", '((!{and}) within MYSECTIONGROUP)') > 0