Home » Server Options » Text & interMedia » Oracle Text and Reserved Words (11g)
Oracle Text and Reserved Words [message #598162] Thu, 10 October 2013 16:54 Go to next message
raman.kashyap
Messages: 9
Registered: July 2013
Junior Member
Hi Team - I am using Oracle Text in one of my project using Lexers and Multi_column datastores. I'm facing some problem with reserved words like "and", "or", "not", "near", "within" etc. Is there any way I can ignore them within Contains query or If I can just disable their native behaviour?

SELECT * FROM CATEGORIES
WHERE CONTAINS(CATEGORYNAME, 'AND', 1) > 0

SELECT * FROM CATEGORIES
WHERE CONTAINS(CATEGORYNAME, 'OR', 1) > 0

SELECT * FROM CATEGORIES
WHERE CONTAINS(CATEGORYNAME, 'ANY OTHER SENTENCE ENDING WITH A RESERVED WORK LIKE AND', 1) > 0


Thanks,
Raman
Re: Oracle Text and Reserved Words [message #598163 is a reply to message #598162] Thu, 10 October 2013 17:15 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9077
Registered: November 2002
Location: California, USA
Senior Member
There are various things that you could do. For example, you could use the REPLACE function to remove those words from your search string or you could escape the words by enclosing them within { and }, causing them to be treated as regular text, instead of reserved words.

Re: Oracle Text and Reserved Words [message #598165 is a reply to message #598163] Thu, 10 October 2013 18:13 Go to previous messageGo to next message
raman.kashyap
Messages: 9
Registered: July 2013
Junior Member
Thanks for replying, Barbara. That makes complete sense what you suggested. But what could be the reason that reserved words are not indexed?
Re: Oracle Text and Reserved Words [message #598166 is a reply to message #598165] Thu, 10 October 2013 18:20 Go to previous messageGo to next message
raman.kashyap
Messages: 9
Registered: July 2013
Junior Member
Thanks again for your help, Barbara. I found my answer on one of your forum here: https://forums.oracle.com/thread/2181803
You are genius Smile
icon7.gif  Re: Oracle Text and Reserved Words [message #598176 is a reply to message #598166] Fri, 11 October 2013 00:33 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Thanks for the link and feedback.

Previous Topic: ORA-900 invalid sql statement error while calling optimize_index procedure from pl/sql
Next Topic: Oracle Text indexes Sync Memory
Goto Forum:
  


Current Time: Thu Mar 28 13:19:14 CDT 2024