Skip to Main Content

How to set my Contains index to ignore operator sign when searching?

DannyS-OracleFeb 15 2018 — edited Feb 28 2018

Hi everyone,

I am a beginner in Oracle Text, please bear with me if I asked simple questions I have tried reading the Docs, but there is too much information to digest, and not straightforward enough to solve my problem.

I have a Context index, and I have set its lexer to identify '-' (hyphen) as a printjoint. In addition, I have marked '#' (hashtag) as a startjoin. But when I am searching using this query:

select *

from   TABLE_NAME

where  contains(MULTI_SEARCH_COL, '#tag-name-30',1)>0

It does not return any result, even though I have one record which has '#tag-name-30' keyword included in its content. If I am using the escape character {}, it works:

select *

from   TABLE_NAME

where  contains(MULTI_SEARCH_COL, '{#tag-name-30}',1)>0

returning 1 result.

My question is, is there a way to configure my index, such that the above pattern can be detected by default without using the escape operator? I am trying to expose a search field to my users, which will query items to the DB using Oracle Text, and I think my users should not need to learn about query operators to use it.

FYI, I am using OracleDB v12. Any feedback will be appreciated, thank you in advance!

Comments
Post Details
Added on Feb 15 2018
1 comment
125 views