My Oracle Support Banner

CTX_DOC.POLICY_MARKUP_CLOB_QUERY With Nested Near=Wrong Results With 7393798 & 8212742 (Doc ID 1407921.1)

Last updated on MARCH 03, 2019

Applies to:

Oracle Text - Version 11.1.0.7.0 and later
Information in this document applies to any platform.

Symptoms

With the fix for unpublished Bug 7393798 installed, when performing these
steps in SQL*Plus:

create table <table_name>(id number, a varchar2(500));
insert into <table_name>
values(1,'AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK LLL MMM NNN OOO
PPP QQQ RRR SSS TTT UUU VVV WWW XXX YYY ZZZ');
commit;
create index <index_name> on <table_name>(a)
indextype is ctxsys.context
parameters('datastore ctxsys.default_datastore stoplist
ctxsys.empty_stoplist');
exec ctx_ddl.create_policy('<table_name>', 'ctxsys.auto_filter', null, null,
'ctxsys.empty_stoplist', null);
declare
mklob clob;
tlob clob;
q clob;
begin
select a into tlob from <table_name> where id = 1;
q := to_clob('NEAR (((NEAR((FFF, GGG), 3, FALSE)),
AAA=BBB=CCC=DDD=RRR), 30, FALSE)');
ctxsys.ctx_doc.policy_markup_clob_query(
policy_name => 'nk_markup',
document => tlob,
text_query => q,
restab => mklob,
starttag => '<a name=h%CURNUM><a style="background:color:">',
endtag => '</a></a>',
prevtag => '<a href=#h%PREVNUM></a>',
nexttag => '<a href=#h%NEXTNUM></a>');
dbms_output.put_line(mklob);
end;


the actual output of the call to CTX_DOC.POLICY_MARKUP_CLOB_QUERY is:

AAA BBB CCC <a name=h1><a style="background:color:">DDD</a></a><a
href=#h2></a> EEE <a
href=#h1></a><a name=h2><a style="background:color:">FFF</a></a><a
href=#h3></a> <a href=#h2></a><a
name=h3><a style="background:color:">GGG</a></a><a href=#h4></a> HHH III
JJJ KKK LLL MMM NNN OOO PPP
QQQ <a href=#h3></a><a name=h4><a style="background:color:">RRR</a></a>
SSS TTT UUU VVV WWW XXX YYY
ZZZ


The correct answer should have AAA, BBB, CCC, DDD as marked up in addition
to FFF, GGG, and RRR.

With the fix for <Bug:8212742> installed, the results remain incorrect:

AAA BBB CCC <a name=h1><a style="background:color:">DDD</a></a><a
href=#h2></a> EEE <a
href=#h1></a><a name=h2><a style="background:color:">FFF</a></a><a
href=#h3></a> <a href=#h2></a><a
name=h3><a style="background:color:">GGG</a></a> HHH III JJJ KKK LLL MMM
NNN OOO PPP QQQ RRR SSS TTT
UUU VVV WWW XXX YYY ZZZ

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.