Problem in using text searching
Posted by: Vikram Malhotra
Date: January 29, 2009 10:43PM

Hello all,

I am trying to do a text search for following scenario:

data_xml
--------------------------------------
<text>hello world</text><image>1</image>
<text>how are you</text>

<text>new</text><image>2</image>
<text>first image</text>
--------------------------------------

Now to search all those records which have
some keyword in <text> tags

I did like

SELECT * FROM tb WHERE data_xml LIKE "%<text>%hello%</text>%";

for this, it correctly gives the first record in result.

Now comes the interesting thing. When I do like

SELECT * FROM tb WHERE data_xml LIKE "%<text>%image%</text>%";

It gives both the records in result. I was expecting only the 2nd record.

Why is this happening? I know why...because the text search engine is greedy in
doing the match. Does someone know a workaround for this? May be using some kind of operator from regular expressions....

Thanks and Regards
Vikram

Options: ReplyQuote


Subject
Written By
Posted
Problem in using text searching
January 29, 2009 10:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.