Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Is Oracle Text PATH_SECTION_GROUP incompatible with highlighting?

Is Oracle Text PATH_SECTION_GROUP incompatible with highlighting?

From: Michael Garfield Sørensen <mgs_at_CeDeT.dk>
Date: Wed, 27 Nov 2002 10:49:24 -0800
Message-ID: <F001.0050DEB6.20021127104924@fatcity.com>

The Oracle Text Reference for 9iR2 says that the INPATH operator (that is only available for PATH_SECTION_GROUPs) does not work with highlighting - and when you try it out, you get an error message - FAIR ENOUGH. The manual does however not say whether highlighting is compatible with PATH_SECTION_GROUP when using the WITHIN operator. When you try it out it does NOT give an error message. But it seems to give the wrong result (which is worse than giving an error message). Are highlighting and PATH_SECTION_GROUP incompatiable regardless of operator (or is it a bug)??

Example is given below. Any help is appreciated.

Regards,
Michael Garfield Sørensen, CeDeT

Example (Oracle9iR2 9.0.2.1 EE on Windows2000 Professional SP3 (DK)):

SQL> connect system/*******
Forbindelsen er oprettet.
SQL> grant ctxapp to scott;

Adgang er givet (Grant).

SQL> connect scott/*****
Forbindelsen er oprettet.
SQL> CREATE TABLE my_content(
  2 normid VARCHAR2(255) NOT NULL,
  3 content CLOB NOT NULL,
  4 CONSTRAINT my_content_pk PRIMARY KEY(normid))   5 LOB(content) STORE AS (CACHE);

Tabel er oprettet.

SQL>
SQL> BEGIN
  2 ctx_ddl.create_section_group('my_content_sg','PATH_SECTION_GROUP');   3 --
  4 END;
  5 /

PL/SQL-procedure er udført.

SQL>
SQL> CREATE INDEX my_content_ix ON my_content(content)   2 INDEXTYPE IS ctxsys.context
  3 PARAMETERS('SECTION GROUP my_content_sg');

Indeks er oprettet.

SQL>
SQL> INSERT INTO my_content(normid,content)   2 VALUES('d1','<BOOK TITLE="Tale of Two Cities">   3 <AUTHORS><AUTHOR NAME="Charles Dickens">Born in England in the town Stratford Upon Avon</AUTHOR></AUTHORS>
  4 <TEXT>It was the best of times.
  5 ...
  6 </TEXT></BOOK>');

1 række er oprettet.

SQL>
SQL> BEGIN
  2 ctx_ddl.sync_index('scott.my_content_ix');   3 END;
  4 /

PL/SQL-procedure er udført.

SQL>
SQL> ANALYZE TABLE my_content COMPUTE STATISTICS;

Tabel er analyseret.

SQL> 
SQL> COLUMN normid FORMAT a20
SQL> PROMPT INPATH works

INPATH works
SQL> SELECT /*+ FIRST_ROWS */ normid,SCORE(1) FROM my_content   2 WHERE CONTAINS(content,'Stratford INPATH(BOOK)',1)>0   3 ORDER BY SCORE(1) DESC;
NORMID                 SCORE(1)       
-------------------- ----------
d1                            3                                        
        

SQL> PROMPT WITHIN works
WITHIN works
SQL> SELECT /*+ FIRST_ROWS */ normid,SCORE(1) FROM my_content   2 WHERE CONTAINS(content,'Stratford WITHIN BOOK',1)>0   3 ORDER BY SCORE(1) DESC;

NORMID                 SCORE(1)
-------------------- ----------        
d1                            3        

SQL> 

SQL> SET SERVEROUTPUT ON SIZE 1000000;
SQL> PROMPT INPATH with highlighting does not work! INPATH with highlighting does not work!
SQL> DECLARE
  2 h_tab ctx_doc.highlight_tab;
  3 BEGIN
  4 ctx_doc.highlight('MY_CONTENT_IX','d1','Stratford INPATH(BOOK)',h_tab,FALSE);   5 DBMS_OUTPUT.PUT_LINE(h_tab.COUNT);   6 FOR i IN 1..h_tab.COUNT LOOP
  7 DBMS_OUTPUT.PUT_LINE('Highlight('||i||'):Offset='||h_tab(i).offset||',Length='||h_tab(i).length);   8 END LOOP;
  9 END;
 10 /
DECLARE
*
FEJL i linie 1:
ORA-20000: Oracle Text-fejl: 
ORA-06512: ved "CTXSYS.DRUE", linje 157 
ORA-06512: ved "CTXSYS.CTX_DOC", linje 914 
ORA-06512: ved linje 4 


SQL>
SQL> PROMPT WITHIN with highlighting seems to be supposed to work - but does it?
WITHIN with highlighting seems to be supposed to work - but does it? SQL> DECLARE
  2 h_tab ctx_doc.highlight_tab;
  3 BEGIN
  4 ctx_doc.highlight('MY_CONTENT_IX','d1','Stratford WITHIN BOOK',h_tab,FALSE);

  5    DBMS_OUTPUT.PUT_LINE('This should be 1, but it is:');
  6    DBMS_OUTPUT.PUT_LINE('----------------------------');
  7    DBMS_OUTPUT.PUT_LINE(h_tab.COUNT);
  8    DBMS_OUTPUT.PUT_LINE('!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
  9    FOR i IN 1..h_tab.COUNT LOOP
 10      DBMS_OUTPUT.PUT_LINE('Highlight('||i||'):Offset='||h_tab(i).offset||',Length='||h_tab(i).length);
 11 END LOOP;
 12 END;
 13 /
This should be 1, but it is:        
----------------------------        
0                                   
!!!!!!!!!!!!!!!!!!!!!!!!!!!!        

PL/SQL-procedure er udført.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: =?Windows-1252?Q?Michael_Garfield_S=F8rensen?=   INET: mgs_at_CeDeT.dk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Nov 27 2002 - 12:49:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US