Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Text Search skiping HTML tags

ratinaMar 24 2010 — edited Apr 4 2010
I have a table containing clob column.

select code, details from search order by code;

CODE DETAILS
---------- -------------------------------------------------------
4 just a <b>test </b>insert
5 just a <b>test</b> insert
9 <HTML>just a <i>test</i> insert</HTML>
10 checking test insert

I have created a context index and add html tags in the stop list.

exec ctx_ddl.create_stoplist('mystop', 'BASIC_STOPLIST');
exec ctx_ddl.add_stopword('mystop', '<b>');
exec ctx_ddl.add_stopword('mystop', '</b>');

CREATE INDEX searchi ON search(details)
INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS
('FILTER CTXSYS.AUTO_FILTER SECTION GROUP CTXSYS.AUTO_SECTION_GROUP STOPLIST MYSTOP');

But when I search 'test insert' it only shows the following rows

SQL> SELECT score(1), code, details FROM search WHERE CONTAINS(details, 'test insert', 1) > 0 ORDER BY score(1);

SCORE(1) CODE DETAILS
---------- ---------- --------------------------------------------------------------------------------
5 10 checking test insert
5 9 <HTML>just a <i>test</i> insert</HTML>

I would like to define a text index which skips the html keywords and returns all the rows contain the searching phrase
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2010
Added on Mar 24 2010
3 comments
2,029 views