Ctx_Doc.Markup Stops Highlighting When Near Has Order As False (Doc ID 1377476.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Text - Version: 10.2.0.4 to 10.2.0.4 - Release: 10.2 to 10.2
Information in this document applies to any platform.

Symptoms

Reproduced in Windows 10.2.0.4 patch 25:

1. When the number of keywords exceeds 10,000 ctx_doc.markup stops
highlighting
2. When the query used includes NEAR with FALSE as order argument it stops
highlighting even before the 10,000.

11.1.0.7.0 and 11.2.0.1.0:
Just item 1. When the number of keywords exceeds 10,000 ctx_doc.markup stops
highlighting

TESTCASE:


conn / as sysdba
create user iconectnxt identified by iconectnxt;
grant connect, resource, dba to iconectnxt;

conn iconectnxt/iconectnxt

drop table test_direct;
create table test_direct (object_id number primary key, extracted_text clob);

-- Insert 5000 times 'andrea mcleod'

declare
i number :=1;
temp_var clob :='andrea mcleod';
begin
loop
temp_var := temp_var || ' andrea mcleod';
i:=i+1;
exit when i>=5000;
end loop;
insert into test_direct values (5000, temp_var);
commit;
end;
/


-- Insert 5001 times 'andrea mcleod'

declare
i number :=1;
temp_var clob :='andrea mcleod';
begin
loop
temp_var := temp_var || ' andrea mcleod';
i:=i+1;
exit when i>=5001;
end loop;
insert into test_direct values (5001, temp_var);
commit;
end;
/

create index test_direct_idx on test_direct (extracted_text)
indextype is ctxsys.context;


drop table markuptab;
create table markuptab (query_id number,
document clob);


-- 5000 clumps = 10000 highlighted words with TRUE
-- This shows all the keywords highlighted

begin
ctx_doc.markup(index_name => 'test_direct_idx',
textkey => '5000',
text_query => 'near((andrea,mcleod),0,TRUE)',
restab => 'markuptab',
query_id => '1',
tagset => 'HTML_DEFAULT');
end;
/

set long 99999999
spool near_true_10000.txt
select document from markuptab
where query_id=1;
spool off



-- 5001 clumps = 10002 highlighted words with TRUE
-- This shows two keywords not highlighted:
/*
ndrea</B> <B>mcleod</B> <B>andrea</B> <B>mcleod</B> <B>andrea</B>
<B>mcleod</B>
andrea mcleod
*/


begin
ctx_doc.markup(index_name => 'test_direct_idx',
textkey => '5001',
text_query => 'near((andrea,mcleod),0,TRUE)',
restab => 'markuptab',
query_id => '2',
tagset => 'HTML_DEFAULT');
end;
/


set long 99999999
spool near_true_10002.txt
select document from markuptab
where query_id=2;
spool off

-- 5000 clumps = 10000 highlighted words with FALSE
-- This shows a lot of terms that are not being highlighted
/*
ndrea</B> <B>mcleod</B> <B>andrea</B> <B>mcleod</B> <B>andrea</B>
<B>mcleod</B>
andrea mcleod andrea mcleod andrea mcleod andrea mcleod andrea mcleod ...
...
*/


begin
ctx_doc.markup(index_name => 'test_direct_idx',
textkey => '5000',
text_query => 'near((andrea,mcleod),0,FALSE)',
restab => 'markuptab',
query_id => '3',
tagset => 'HTML_DEFAULT');
end;
/

set long 99999999
spool near_false_10000.txt
select document from markuptab
where query_id=3;
spool off

-- 5001 clumps = 10002 highlighted words with FALSE
-- This also shows a lot of terms not being highlighted.
/*
ndrea</B> <B>mcleod</B> <B>andrea</B> <B>mcleod</B> <B>andrea</B>
<B>mcleod</B>
andrea mcleod andrea mcleod andrea mcleod andrea mcleod andrea mcleod ...
...
*/
begin
ctx_doc.markup(index_name => 'test_direct_idx',
textkey => '5001',
text_query => 'near((andrea,mcleod),0,FALSE)',
restab => 'markuptab',
query_id => '4',
tagset => 'HTML_DEFAULT');
end;
/

set long 99999999
spool near_false_10002.txt
select document from markuptab
where query_id=4;
spool off

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