Oracle Text (MOSC)

MOSC Banner

CONTAINS with middle wildcard

edited Jul 2, 2014 5:00AM in Oracle Text (MOSC) 1 commentAnswered

Hi,

I have a table with two columns: user_id and username, containing 5 rows:

user_id  user_name

1           Bob Smith

2           David John Strum

3           John Stein

4           John Stuart

5           John Snow

Then I use this select to get all users that match a certain filter: select * from users where username like ('%John%St%');

This will return row 2, row 3 and row 4.

How can I use the CONTAINS function of Oracle Text in order to achieve the same result?

I've tried by adding preferences for basic wordlist, prefix, wildcard maxterms etc but it doesn't work. If I use contains('John%') it works but if I add something else after the wildcard I receive no results.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center