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

Last updated on FEBRUARY 07, 2012

Applies to:

Oracle Text - Version: 11.1.0.7.0 and later   [Release: No Release Description 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 nk_near(id number, a varchar2(500));
insert into nk_near
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 nk_near_ndx on nk_near(a)
indextype is ctxsys.context
parameters('datastore ctxsys.default_datastore stoplist
ctxsys.empty_stoplist');
exec ctx_ddl.create_policy('nk_markup', 'ctxsys.auto_filter', null, null,
'ctxsys.empty_stoplist', null);
declare
mklob clob;
tlob clob;
q clob;
begin
select a into tlob from nk_near 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


Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms