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!

Q: How to ignore operators inside CONTAINS ?

mackrispiMay 4 2012 — edited Apr 16 2013
Hi,

I use Context index for the search.

The query :
SELECT * FROM S_ARTICLE WHERE  CONTAINS(ORATEXT,'BT-50')>0 
The problem is that BT is reserved word for Contains ....Broader Term ... and therefor I get

ORA-20000: Oracle Text error:
DRG-50901: text query parser syntax error on line 1, column 3

I read that putting BT like {BT} would work .... but the problem is that I don't know what the user will type in ... query is created dynamicaly so I
never know what is user typing I just put it inside CONTAINS ... and I would preffer to have it like this :)

I tried to write queries like " CONTAINS(ORATEXT,'{BT-50 GOOD BREAD}' .... so putting the whole search phrase in brackets .... and it looks like it works ....

So I would just like to get some confirmation from you guys, that this is actually correct ... if not then please correct me and please give me some example of how to do it better and correct.

Thank you,
Kris
This post has been answered by Barbara Boehmer on May 4 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2013
Added on May 4 2012
7 comments
8,025 views