3 Replies Latest reply: Aug 13, 2013 12:49 PM by Barbara Boehmer RSS

    oracle text error (DRG-10502);entity extraction;ctx_entity.extract

    user7753875

      Dear sirs,

       

      I am user of oracle 11g release 2. I am attempting to use the entity extraction feature of oracle text for the first time.

      When I execute the following statement via sql developer:

      ctx_entity.extract('POL05',my_document,'ENGLISH',my_results);

       

      I am getting the following:

      ORA-2000: Oracle Text error:

      DRG-10502: index POL05 does not exist

       

      Any comments and/or suggestions?

       

      Why is POL05 referred to as an index instead of a policy?

       

       

       

       


        • 1. Re: oracle text error (DRG-10502);entity extraction;ctx_entity.extract
          Barbara Boehmer

          What do you get if you execute it from SQL*Plus instead of SQL Developer?  Please post a copy and paste of a whole reproducible test case from SQL*Plus.

          • 2. Re: oracle text error (DRG-10502);entity extraction;ctx_entity.extract
            user7753875

            https://blogs.oracle.com/searchtech/entry/using_entity_extraction

            Please note that Entity Extraction uses some third party technology "under the covers" which is deliberately disabled in 11.2.0.3. If you run these examples in 11.2.0.3 (or 11.2.0.4 when it's out) you will receive a "feature not generally available" message. The functionality can be re-enabled, but only by contacting Oracle Support so they can run some checks on whether your applications will be affected by the replacement of this third party technology in the next major release.

            • 3. Re: oracle text error (DRG-10502);entity extraction;ctx_entity.extract
              Barbara Boehmer

              If you upgrade to Oracle 12c, it works in that version, as shown below.

               

              SCOTT@orcl12c_11gR2> select banner from v$version

                2  /

               

              BANNER

              --------------------------------------------------------------------------------

              Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production

              PL/SQL Release 12.1.0.1.0 - Production

              CORE    12.1.0.1.0    Production

              TNS for 64-bit Windows: Version 12.1.0.1.0 - Production

              NLSRTL Version 12.1.0.1.0 - Production

               

              5 rows selected.

               

              SCOTT@orcl12c_11gR2> create table docs

                2    (id   number,

                3      txt  clob)

                4  /

               

              Table created.

               

              SCOTT@orcl12c_11gR2> insert into docs (id, txt) values (1,

                2  'Sam A. Schwartz retired as executive vice president of Hupplewhite INc. in New York.')

                3  /

               

              1 row created.

               

              SCOTT@orcl12c_11gR2> begin

                2    ctx_entity.create_extract_policy ('POL05');

                3  end;

                4  /

               

              PL/SQL procedure successfully completed.

               

              SCOTT@orcl12c_11gR2> create table entities

                2    (id      number,

                3      entities    xmltype)

                4  /

               

              Table created.

               

              SCOTT@orcl12c_11gR2> declare

                2    my_results   clob;

                3  begin

                4    for r in (select * from docs) loop

                5       ctx_entity.extract ('POL05', r.txt, 'ENGLISH', my_results);

                6       insert into entities (id, entities) values (r.id, xmltype (my_results));

                7    end loop;

                8  end;

                9  /

               

              PL/SQL procedure successfully completed.

               

              SCOTT@orcl12c_11gR2> select * from entities order by id

                2  /

               

                      ID

              ----------

              ENTITIES

              --------------------------------------------------------------------------------

                       1

              <entities>

                <entity id="0" offset="75" length="8" source="SuppliedDictionary">

                  <text>New York</text>

                  <type>city</type>

                </entity>

                <entity id="1" offset="27" length="24" source="SuppliedDictionary">

                  <text>executive vice president</text>

                  <type>person_jobtitle</type>

                </entity>

                <entity id="2" offset="0" length="15" source="SuppliedRule">

                  <text>Sam A. Schwartz</text>

                  <type>person_name</type>

                </entity>

                <entity id="3" offset="75" length="8" source="SuppliedDictionary">

                  <text>New York</text>

                  <type>state</type>

                </entity>

              </entities>

               

               

              1 row selected.

               

              SCOTT@orcl12c_11gR2> column type format a30

              SCOTT@orcl12c_11gR2> column text format a30

              SCOTT@orcl12c_11gR2> select e.id, t.type, t.text

                2  from   entities e,

                3          xmltable

                4             ('/entities/entity'

                5          passing e.entities

                6          columns

                7            offset    number    PATH '@offset',

                8            lngth    number    PATH '@length',

                9            text       varchar2(50) PATH 'text/text()',

              10            type       varchar2(50) PATH 'type/text()',

              11            source   varchar2(50) PATH '@source') t

              12  /

               

                      ID TYPE                           TEXT

              ---------- ------------------------------ ------------------------------

                       1 city                           New York

                       1 person_jobtitle                executive vice president

                       1 person_name                    Sam A. Schwartz

                       1 state                          New York

               

              4 rows selected.