Skip to Main Content

Oracle text wild card search

KarkiJan 28 2019 — edited Jan 29 2019

I have a cc_products table and created below index on it

CREATE INDEX PRODUCTS_IDX ON CC_PRODUCTS

(PRODUCT)

INDEXTYPE IS CTXSYS.CONTEXT;

I have product like:

DYDUGD SAMSUNG GALAXY S4

CVDUGD SAMSUNG GALAXY S9

XJDUAJA  SAMSUNG GALAXY NOTE 5

I want to search by typing: "DUGD SAMSUNG" or "SAMSUNG DUGD" should give exactly the following output:

DYDUGD SAMSUNG GALAXY S4

CVDUGD SAMSUNG GALAXY S9

However use of wild card * or % in condition as:

WHERE contains (d,parser.progrelax ('SAMSUNG *DUGD'),1) > 0

OR

WHERE contains (d,parser.progrelax ('*DUGD SAMSUNG'),1) > 0

returning the third product with XJDUAJA also.

Comments
Post Details
Added on Jan 28 2019
7 comments
212 views