3 Replies Latest reply on Oct 12, 2012 4:21 PM by Barbara Boehmer

    trying to understand context indexes and contains-help

      i am using
      Achieving functionality of many preferences using one context index
      to understand context indexes and contains
      and i get the following
      Error starting at line 1 in command:
      ctx_ddl.create_preference ('nd_mcds', 'multi_column_datastore');
      ctx_ddl.set_attribute ('nd_mcds', 'columns', 'text nd, text text');
      ctx_ddl.create_section_group ('nd_sg', 'basic_section_group');
      ctx_ddl.add_ndata_section ('nd_sg', 'nd', 'nd');
      ctx_ddl.create_preference ('test_lex', 'basic_lexer');
      ctx_ddl.set_attribute ('test_lex', 'whitespace', '/\|-_+');
      Error report:
      ORA-06550: line 5, column 15:
      PLS-00302: component 'ADD_NDATA_SECTION' must be declared
      ORA-06550: line 5, column 7:
      PL/SQL: Statement ignored
      06550. 00000 - "line %s, column %s:\n%s"
      *Cause:    Usually a PL/SQL compilation error.
      so i am using the following to check for the error
      oracle text application developer's guide
      oracle text reference
      but these have not listed that error (i have even googled this in vain)
      background::we were actually using catsearch but because of its downsides i want to implement this
      Is Achieving functionality of many preferences using one context index a good place to start when one does not know about
      context and contains??
      please post any other useful link for contains and context index that even explains
      1) fuzzy
      2) stem
      3) synonym
      4) near
      5) soundex
      thanks in advance
        • 1. Re: trying to understand context indexes and contains-help
          Barbara Boehmer
          Ndata is new to Oracle 11g. Your other posts indicate that you are using Oracle 10g, so you don't have ndata, so you get an error when you try to use it. If you want to use the 11g features that enable context indexes with contains to do all of the things that ctxcat indexes with catsearch do, then you need to upgrade to 11g.

          The online documentation is searchable. Most things regarding Oracle Text are contained in either the Oracle Text Reference or the Oracle Text Application Developer's guide.

          I suggest that you start with something very simple, then build from there.

          The following is similar to your other post that used catsearch:
          SCOTT@orcl_11gR2> CREATE TABLE mv_cat_seg_reg_prod
            2    (cat_ids       VARCHAR2 ( 7),
            3       act_status    VARCHAR2 (10),
            4       name           VARCHAR2 ( 1),
            5       email           VARCHAR2 ( 1),
            6       address1      VARCHAR2 ( 1),
            7       address2      VARCHAR2 ( 1),
            8       contact_name  VARCHAR2 ( 1),
            9       mobile           VARCHAR2 ( 1),
           10       telephone     VARCHAR2 ( 1))
           11  /
          Table created.
          SCOTT@orcl_11gR2> INSERT ALL
            2  INTO mv_cat_seg_reg_prod VALUES
            3    ('1', 'Y', 'A', 'B', 'C', 'D', 'E', 'F', 'G')
            4  INTO mv_cat_seg_reg_prod VALUES
            5    ('2', 'N', 'H', 'I', 'J', 'K', 'L', 'M', 'N')
            6  SELECT * FROM DUAL
            7  /
          2 rows created.
          SCOTT@orcl_11gR2> CREATE INDEX mv_cat_seg_reg_prod_idx
            2  ON mv_cat_seg_reg_prod (cat_ids)
            4  /
          Index created.
          SCOTT@orcl_11gR2> SELECT token_text FROM dr$mv_cat_seg_reg_prod_idx$i
            2  /
          2 rows selected.
          SCOTT@orcl_11gR2> SELECT *
            2  FROM   (SELECT SCORE (1), name, email, address1, address2, contact_name, mobile, telephone
            3            FROM   mv_cat_seg_reg_prod
            4            WHERE  CONTAINS (cat_ids, '1', 1) > 0
            5            AND    act_status = 'Y'
            6            ORDER  BY DBMS_RANDOM.VALUE)
            7  WHERE  ROWNUM < 8
            8  /
            SCORE(1) N E A A C M T
          ---------- - - - - - - -
                   4 A B C D E F G
          1 row selected.
          1 person found this helpful
          • 2. Re: trying to understand context indexes and contains-help
            i am referring this now
            everything else except ndata is there in "Oracle Database 10g Enterprise Edition Release - Prod" right??

            Edited by: 946207 on Oct 12, 2012 6:12 PM
            • 3. Re: trying to understand context indexes and contains-help
              Barbara Boehmer
              At a quick glance, it looks like you have everything you need in Oracle 10g to successfully run the examples provided in that page of the nice little starter tutorial you found.

              The following is a complete list of the Oracle Text features that are new to 11g, although you may not see the same terminology used. For example ndata is referred to as name matching. Note that it is divided into what was introduced in 11.1 and what was introduced in 11.2.

              1 person found this helpful