CTXCAT index support MULTI_COLUMN_DATASTORE?

I've been using a CONTEXT index in my app, however, having to re-synchronize the index is an issue with my high insert rate. So, I'm considering using a CTXCAT since all db updates are transactional.
However, my CONTEXT query uses a MULTI_COLUMN_DATASTORE to query multiple columns via the concatenated column and it doesn't look like the CTXCAT index will support MULTI_COLUMN_DATASTORE? Does anyone know?
If the MULTI_COLUMN_DATASTORE is not supported, is there an alternative query I could use whilst still being able to use CTXCAT index?
Many thanks!

Hi David,
Until you get to 10g would a job that sync's frequently work? It sounds like the new sync on commit is what you need (provided it wouldn't cause performance problems for you), so would the job be an acceptable workaround until you upgrade?
-Ron

Similar Messages

  • Ctxcat index supporting multicolumn datastore

    I've been looking to see if a ctxcat index supports something like a multicolumn datastore.
    What I'm trying to do is to search multiple columns (all 256 bytes in size or less) using a like query on each of those columns with the result being ordered by up to 3 different non searched columns
    For example, the book scenerio
    A table with the following columns
    title
    publisher
    author
    publication_date
    quantity
    location
    I want to be able to search on title, publisher, and author all at once (optionally searching the tokens with % symbols), and then sorting on publication_date, quantity and location.
    Now doing the context index, it worked fine, until I started ordering the results. Straight "like" queries with the ordering were returning quicker.
    So I've started looking at ctxcat indexes to provide the flexibility of mixed query searching using the "order by" in the catsearch function.
    The question is, how do I setup and search all three columns(title, publisher, author) at once with ctxcat index? Since ctxcat indexes don't support support the datastore option, how do you search on multi-columns? Do I need to make a concatenated column with title, publisher and author, or is there something in the configuration of the ctxcat index that I'm missing?

    i have exactly the same situation - that is i need to search on four columns and am trying to use ctxcat ...
    but the twist i have is - based on what coulmns the user wants to search - i want to limit the serach to ONLY those columns
    Is there some way to do that using ctxcat ? ... other than creating a large number of extra columns containing different combinations of searchable columns... yikes ... wont even go there ....

  • CTXCAT index problem: SUBSTRING_INDEX parameter doesn't work

    Hi,
    I need a help with ctxcat index on Oracle 10g. I need to improve searching using CTXCAT index. All is working quite well except SUBSTRING_INDEX parameter. I thought that following was necessary and sufficient:
    EXEC ctx_ddl.create_preference('KEVFT_WL', 'BASIC_WORDLIST');
    EXEC ctx_ddl.set_attribute('KEVFT_WL', 'substring_index', 'YES');
    EXEC ctx_ddl.set_attribute('KEVFT_WL', 'prefix_index', 'YES');
    EXEC ctx_ddl.set_attribute('KEVFT_WL', 'prefix_min_length', 1);
    EXEC ctx_ddl.set_attribute('KEVFT_WL', 'prefix_max_length', 6);
    This BASIC_WORDLIST preference set is used for index creation. But the problem is, that when I try to search using query:
    SELECT * FROM TMP_FULLTEXT
    WHERE CATSEARCH(fulltext, '%abc', null)> 0;
    then I get no rows in results. Despite the fact that row with the text 'aabc' exists in the table.
    Can anyone tell me what the problem is?
    Thank you,
    Julius Chrobak

    With a catsearch query operator, the wildcard is an asterisk (*), not a percent sign (%) as with a contains query operator. However, even with the correct wildcard, left truncation is not supported with ctxcat. However, if you use a query template, then you can use the context grammar with the % wildcard for context grammar and left truncation is supported. Please see the demonstration below that reproduces the problem, then corrects it.
    SCOTT@10gXE> SELECT * FROM v$version
      2  /
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SCOTT@10gXE> CREATE TABLE tmp_fulltext (fulltext VARCHAR2 (30))
      2  /
    Table created.
    SCOTT@10gXE> INSERT ALL
      2  INTO tmp_fulltext VALUES ('aabc')
      3  INTO tmp_fulltext VALUES ('abcd')
      4  SELECT * FROM DUAL
      5  /
    2 rows created.
    SCOTT@10gXE> BEGIN
      2    ctx_ddl.create_preference ('KEVFT_WL', 'BASIC_WORDLIST');
      3    ctx_ddl.set_attribute      ('KEVFT_WL', 'substring_index',   'YES');
      4    ctx_ddl.set_attribute      ('KEVFT_WL', 'prefix_index',        'YES');
      5    ctx_ddl.set_attribute      ('KEVFT_WL', 'prefix_min_length', 1);
      6    ctx_ddl.set_attribute      ('KEVFT_WL', 'prefix_max_length', 6);
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX fulltext_idx ON tmp_fulltext (fulltext)
      2  INDEXTYPE IS CTXSYS.CTXCAT
      3  PARAMETERS ('WORDLIST KEVFT_WL')
      4  /
    Index created.
    SCOTT@10gXE> -- reproduction of original problem using wrong wildcard for catsearch:
    SCOTT@10gXE> SELECT * FROM TMP_FULLTEXT
      2  WHERE CATSEARCH (fulltext, '%abc', null) > 0
      3  /
    no rows selected
    SCOTT@10gXE> SELECT * FROM TMP_FULLTEXT
      2  WHERE CATSEARCH (fulltext, 'abc%', null) > 0
      3  /
    no rows selected
    SCOTT@10gXE> -- left truncation not supported, even with correct wildcard:
    SCOTT@10gXE> SELECT * FROM TMP_FULLTEXT
      2  WHERE CATSEARCH (fulltext, '*abc', null) > 0
      3  /
    no rows selected
    SCOTT@10gXE> SELECT * FROM TMP_FULLTEXT
      2  WHERE CATSEARCH (fulltext, 'abc*', null) > 0
      3  /
    FULLTEXT
    abcd
    SCOTT@10gXE> -- query using template with context grammar:
    SCOTT@10gXE> SELECT * FROM TMP_FULLTEXT
      2  WHERE CATSEARCH
      3            (fulltext,
      4             '<query>
      5             <textquery grammar="context">
      6               %abc
      7             </textquery>
      8              <query>',
      9             null) > 0
    10  /
    FULLTEXT
    aabc
    SCOTT@10gXE>

  • Error when hit ctxsys.ctxcat index

    I use SQL query to generated report page in HTML DB, the query hit Oracle ctxsys.ctxcat indexes, after sent query, I got this error message. My question is: Does HTML DB support ctxsys.ctxcat index?
    report error:
    ORA-20000: Oracle Text error:
    DRG-10849: catsearch does not support functional invocation
    My sample query:
    SELECT distinct(FEATURE_ID),
    FEATURE_NAME
    from maint_query_view
    where FEATURE_NAME_OFFICIAL = 'Y'
    and feature_id in (select feature_id from maint_query_view
    where (catsearch(:FEATURENAME, 'index',null)>0);
    Thanks
    Lei

    Lei,
    1) HTML DB does support the CTXCAT index type.
    2) The error you've encountered seems specific to Oracle Text and not HTML DB (I would suspect you would encounter the same error if you issued the query from SQL*Plus).
    It's best to file a TAR with Oracle Worldwide Support on this one.
    Joel

  • CONTEXT index vs a CTXCAT index

    I'm puzzled as to which of these indexes is meant for what purpose. I like the auto-update feature of the CTXCAT index, so I'm leaning that direction.
    Here's our situation. We have a table with about 2 million rows, where there's an EMPLOYER_NAME field. Users are constantly executing queries like:
    where EMPLOYER_NAME like '%CHEVRON%'The CTXCAT index is also described as "Typically, with this index type, you index small documents or text fragments". I would consider this EMPLOYER_NAME column (VARCHAR2(50)) to fit this description, more or less.
    The main thing that has me confused is that our vendor is pushing for a CONTEXT index, as they've got experience setting these up. We're not storing "text consists of large coherent documents.", but we are storing plain text.
    Could someone offer some guidance? Thanks for your help,
    --=Chuck

    Depends on whether the words are predictable. You indicated in your first post they are employer names. If they are then presumably there is a table/list of valid values. Otherwise a CTX index may be your best shot but understand that you will be indexing every word and, I assume, most will be irrelevant.

  • Error while importing table having ctxcat index

    Hi
    I created a table and ctxcat index on the same. I exported the same. While importing, table got imported but for index creation it gave error imp-00017 with ora-29855.
    Though the index have been created but with some errors. I can see the index in all_indexes table but if i try to see the entry in dba_segments, record is not found.
    Seems that index is not created properly.
    Pls suggest ASAP.
    Regards
    Rajiv

    What's your source and target Oracle version ?
    1) make sure context option is installed on target DB
    2) create a user ctxsys, the schema where the context related objects resides

  • SQL Azure indexer support for Collection(Edm.String)

    Is there a plan to support "Collection(Edm.String)
    " with a SQL Azure indexer? Maybe via an XML type?
    Unless I'm misunderstanding the supported types
    https://msdn.microsoft.com/en-us/library/azure/dn946880.aspx
    It sort of fizzles out after "time, timespan" but I'm assuming it's Not Supported's all the way down

    http://feedback.azure.com/forums/263029-azure-search/suggestions/7189214-sql-azure-indexer-support-for-collection-edm-strin
    Was going to start there but just wanted to vet that it indeed wasn't there.... I realize it's a bit awkward and anti - sql storing data like that in a column and will probably annoy DBAs.
     Currently the data we'd use this for would be Customer phone numbers, addresses, VIN for vehicles, and some account numbers... So nothing super fancy...   Straight delimiters might get funky with addresses but maybe a standard backspace escape
    sequence or letting user use ascii hexcode if the delimiter is in the text..  
    For now we already have a comma separated SearchText field we've indexed for use with FTS and I just pointed an Edm.string at that column in our DB and it seems to pick up all the comma separated elements... But I'm guessing it's not as efficient as if it
    was stored in more specific collections.

  • Any way to utilize CTXCAT index?

    I’ve been looking into trying to add indexes to columns in a table which have a data type of VARCHAR2(4000). Does anyone know if there is a way to utilize a CTXCAT index from an OBIEE request? It requires a special syntax in the where clause so I'm not sure if there is a way to make OBIEE actual take advantage of the index if I do create it.
    Edited by: PBizme on May 6, 2010 2:31 PM

    Incase anyone else needs it, here are the pinouts:
    - Analog Ground
    2 - Analog Headphone Out Left
    3 - Audio Backpanel Mute -- short to ground to mute the backpanel (when headphones are plugged in)
    4 - Analog Headphone Out Right
    5 - same as #3
    6 - Mic input from front panel
    7 - key pin (shouldn't be there)
    8 - VREF out -- voltage reference for Mic
    9 - MIC IN MUTE -- ground when mic isn't plugged in, +2VDC when mic is plugged in
    0 - Audio cable detect -- will be ground when headphones are plugged in (not normally used)
    Side view of the card:
    [img"]http://www.cs.rpi.edu/&#37;7Ehollec/images/sonata+audigy.jpg">

  • CTXSYS.CTXCAT index and CATSEARCH problem

    I have table with just one column indexed (CBG_COMPANY_HOUSE_STREET_DIST) with CTXSYS.CTXCAT index. And the problem is that
    words like 'OR', 'IF', 'MR', 'MRS', 'A' and some more like these are NOT INDEXED at all..! So simply when I try to use CATSEARCH like
    select * from ros_dev.MAD_PLACES_DEDUPE where CATSEARCH(CBG_COMPANY_HOUSE_STREET_DIST,'MRS',null) > 0
    I get no results at all...
    What is the reason? What is the solution? Please, it is URGENT, I develope some software , I am not a DBA, and I have a deadline on Friday :(
    Thanks for any help!

    Ok - I just responded to your post over in the database forum. Same answer applies here. If you need help redoing the index, best to post here rather than the General Database forum though since it is definitely Text specific.
    Thanks,
    Ron

  • Create CTXCAT  index in parallel mode

    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production with oracle text version 11.2.0.2.0.
    Following script is used to create the ctxcat index but I noticed it is not creating the index in parallel. We have 16 cpu server. The table onto which text index is created has no partition.
    BEGIN
    --Storage preference
    Ctx_Ddl.Create_Preference ('IDX_STORE', 'basic_storage');
    Ctx_Ddl.Set_Attribute (preference_name => 'IDX_STORE',
    attribute_name => 'I_TABLE_CLAUSE',
    attribute_value => 'TABLESPACE C_DATA_02');
    Ctx_Ddl.set_attribute ('IDX_STORE',
    'I_INDEX_CLAUSE',
    'TABLESPACE C_IDX_02 COMPRESS 2');
    Ctx_Ddl.set_attribute (
    'IDX_STORE',
    'R_TABLE_CLAUSE',
    'TABLESPACE C_DATA_02 LOB(DATA) STORE AS (CACHE)'
    --Wordlist
    ctx_ddl.create_preference ('nbcwordlist', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute ('nbcwordlist', 'PREFIX_INDEX', 'TRUE');
    ctx_ddl.set_attribute ('nbcwordlist', 'PREFIX_MIN_LENGTH', 1);
    ctx_ddl.set_attribute ('nbcwordlist', 'PREFIX_MAX_LENGTH', 64);
    ctx_ddl.set_attribute ('nbcwordlist', 'SUBSTRING_INDEX', 'NO');
    END;
    CREATE INDEX FTS_IDX ON INDVL_SRCH_NM (SRCH_NM)
    INDEXTYPE IS CTXSYS.CTXCAT
    PARAMETERS('STORAGE IDX_STORE STOPLIST C_STOPLIST WORDLIST C_WORDLIST')
    PARALLEL (DEGREE 16);
    What should be done to create this index in parallel? Is there any other thing that can be done to speed up creation without disabling prefix index.
    Thanks. I appreciate you time and effort.
    Edited by: spur230 on Nov 14, 2011 4:53 PM

    Hi,
    in the manual some remarks are made for parallel indexing, see http://download.oracle.com/docs/cd/E14072_01/text.112/e10945/ind.htm#CIHCBABI
    So it is possible to index in parallel, but you don't have control, the oracle db decides this for you. So it is possible that Oracle thinks that single indexing is faster, more work is done in the database besides the index creation, and many more factors (also mentioned in above document).
    I did many parallel indexing on systems, but always on quiet moments, so I have the most resources for creating indexes. Furthermore I noticed that system statistics can influence the creation. If the statistics are good for the CPU and I/O, the parallel creation can be optimised by the db.
    Herald ten Dam
    http://htendam.wordpress.com

  • CTXCAT index and VPD?

    Hi all,
    after looking into the logfile of IMPDP, i found this:
    Failing sql is:
    CREATE INDEX "Q1"."CTX1_AX_CODE" ON "Q1"."XREF" ("CODE")  INDEXTYPE IS "CTXSYS"."CTXCAT"  PARAMETERS ('STOPLIST CTXSYS.EMPTY_STOPLIST
                 LEXER global_lexer
                 WORDLIST global_wordlist
                 STORAGE CTXSTORE')P
    ORA-39083: Object type INDEX failed to create with error:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in drsxsopen
    ORA-28100: policy function schema LICENSE is invalidI think the first 8 lines are saying some errors regarding ORACLE TEXT, and the last line is a VPD error, right?
    it's confusing, how could an ORACLE TEXT index have anything to do with VPD? I don't see any relations between them.
    anyone have any ideas?
    thanks in advance

    Rafi (Oracle DBA) wrote:
    Hi,
    Cause:
    Starting with 10g CTXSYS no longer has DBA privileges. Traditionally, in previous releases, CTXSYS has been allowed to sync any index. But we have been moving toward the model that only the index owner or DBA can sync a given index.
    Solution
    To implement the solution, please upgrade to 11gR2, 11.2.0.2, where the problem is fixed.
    Prior 11.2.0.2 you should change your PL/SQL code and use the owner of the index to SYNC, or a DBA user.
    For more details check the below MY ORACLE SUPPORT NOTE:
    DRG-50857 When Synchronizing Indexes as CTXSYS [ID 351361.1]
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com/
    Hi,
    version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    I use SYS to do the IMPDP, can this avoid the privilege issue you mentioned?

  • XMLType index supporting position in XPath

    I would like to know if it is possible to create index which will support position function in XPath.
    For example:
    Xpath:
    select extractValue(p.pack_content,'/Data/Contractors/Contractor[278]/PermissionNumber')
    from packages p;
    The table packages is based on the schema and it is created by the statement:
    CREATE TABLE packages
    (pack_id NUMBER primary key,
    pack_content XMLType
    XMLTYPE COLUMN pack_content
    XMLSCHEMA "http://www.example.com/example" ELEMENT "Data"
    VARRAY pack_content."XMLDATA"."Contractors"."Contractor"
    STORE AS TABLE pkg_contractors
    ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$))
    ORGANIZATION INDEX OVERFLOW);
    What kind of indexes should I create?
    Grzegorz.

    Just a stupid example to see if it could be done (not that it works);
    Does it make any sense ?
    No idea if this will work for you, you should further test it
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    5 rows selected.
    SQL> create table temp
      2  (lclob xmltype)
      3  ;
    Table created.
    SQL> insert into temp
      2  values('<itemMaster>
      3  <itemNumber>001000222</itemNumber>
      4  <itemDesc>HGR REUSE BX FOR HANGERRTNS </itemDesc>
      5  <paltSize>1</paltSize>
      6  <stdUOM>1</stdUOM>
      7  <shflfUOM>1</shflfUOM>
      8  <aliases>
      9  <upcCode>123456</upcCode>
    10  <upcCode>490010002222</upcCode>
    11  </aliases>
    12  </itemMaster>
    13  ')
    14  ;
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select extractvalue(lclob,'/itemMaster/aliases/upcCode[position()=2]') from temp;
    EXTRACTVALUE(LCLOB,'/ITEMMASTER/ALIASES/UPCCODE[POSITION()=2]')
    490010002222
    1 row selected.
    SQL> set autotrace on
    SQL> select extractvalue(lclob,'/itemMaster/aliases/upcCode[position()=2]') from temp;
    EXTRACTVALUE(LCLOB,'/ITEMMASTER/ALIASES/UPCCODE[POSITION()=2]')
    490010002222
    1 row selected.
    Execution Plan
    Plan hash value: 1896031711
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |  2002 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| TEMP |     1 |  2002 |     3   (0)| 00:00:01 |
    Note
       - dynamic sampling used for this statement
    Statistics
              0  recursive calls
              0  db block gets
              7  consistent gets
              0  physical reads
              0  redo size
            476  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> create index pos_idx on temp
      2  (extractvalue(lclob,'/itemMaster/aliases/upcCode[position()]'));
    Index created.
    SQL> select extractvalue(lclob,'/itemMaster/aliases/upcCode[position()=2]') from temp;
    EXTRACTVALUE(LCLOB,'/ITEMMASTER/ALIASES/UPCCODE[POSITION()=2]')
    490010002222
    1 row selected.
    Execution Plan
    Plan hash value: 1896031711
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |  2002 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| TEMP |     1 |  2002 |     3   (0)| 00:00:01 |
    Note
       - dynamic sampling used for this statement
    Statistics
             19  recursive calls
              0  db block gets
             19  consistent gets
              0  physical reads
              0  redo size
            476  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> begin  dbms_stats.set_table_stats
      2  ( ownname => 'MARCO'
      3  , tabname => 'TEMP'
      4  , numrows => 50000000  , numblks => 1200000  );
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select extractvalue(lclob,'/itemMaster/aliases/upcCode[position()=1]') from temp;
    EXTRACTVALUE(LCLOB,'/ITEMMASTER/ALIASES/UPCCODE[POSITION()=1]')
    123456
    1 row selected.
    Execution Plan
    Plan hash value: 1896031711
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    50M|  4768M|   265K  (2)| 00:53:04 |
    |   1 |  TABLE ACCESS FULL| TEMP |    50M|  4768M|   265K  (2)| 00:53:04 |
    Statistics
              8  recursive calls
              0  db block gets
              9  consistent gets
              0  physical reads
              0  redo size
            470  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedMessage was edited by:
    mgralike

  • "Failed to open cursor" while creating CTXCAT index. Bug?

    Hi,
    I'm trying to create a catalog index on a rather large table. And I am consistently getting the following error. When the table was half the size, the same CREATE INDEX statement worked just fine. However, when the table grows to a certain size, that statement no longer works.
    I searched the whole forum and I did not find anything about this error. Am I the first to encounter it? Can this be a bug?
    Any advice is greatly appreciated.
    Yongtao
    SQL>create index myindex on mytable(mycolumn) indextype is ctxsys.ctxcat parameters ('index set myindexset section group mysectiongroup stoplist mystoplist storage mystorage lexer mylexer');
    create index myindex on mytable(mycolumn) indextype is ctxsys.ctxcat parameters ('index set myindexset section group mysectiongroup stoplist mystoplist storage mystorage lexer mylexer')
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-50800: failed to open cursor
    DRG-50857: oracle error in drsxsopen
    ORA-00942: table or view does not exist
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.CATINDEXMETHODS", line 97
    Elapsed: 09:07:26.25
    SQL>

    Looks like a bug to me. Did it error out immediately, or only after processing for some time?
    Do you get the same problem without the storage clause?

  • Is two level indexing supported

    Hi,
    Is two level indexing possible for jar files? I tried following:
    jar -i a.jar b.jar c.jar
    jar -i main.jar a.jar
    (index.list of a.jar contains all classes/packages of b.jar and c.jar, and index.list of main.jar contains all classes/packages of a.jar, as I expected)
    When the program tries to access any class from b.jar or c.jar, I get ClassNotDef error and the applet doesn't run. Am I missing something here or is it just not possible to have two level indexing for jar files.
    Any help will be appreciated.
    -jas

    No, I am not putting a jar file in another one. What I want to do is to index only one file from main.jar (jar file containing main class). And then index more jar files from that first indexed file, so that my main class doesn't have to worry about many jar files.

  • Question on optimum choice of index - whether to use CTXCAT or CONTEXT

    Hi ,
    I have a situation in which there are short texts that are to be searched for diacritical characters and for that I implemented CTXCAT type of index. The solution works fine except for left side wild card search - in that case I have suggested the developers to use the query template feature. -this is the background information for the question I have and following example demonstrates it:
    CREATE TABLE TEST_USER
      FIRST_NAME  VARCHAR2(64 CHAR)                 NOT NULL,
      LAST_NAME   VARCHAR2(64 CHAR)                 NOT NULL
    CREATE INDEX TEST_USER_IDX3 ON TEST_USER
    (FIRST_NAME)
    INDEXTYPE IS CTXSYS.CTXCAT
    PARAMETERS('LEXER cust_lexer');
    CREATE INDEX TEST_USER_IDX4 ON TEST_USER
    (LAST_NAME)
    INDEXTYPE IS CTXSYS.CTXCAT
    PARAMETERS('LEXER cust_lexer');
    Don't worry about the cust_lexer, it is for diacritical search and it is not relevant to this question so I am not copying the code for the preference I created etc.
    Now I have a row of data in the table with first_name column as Supervisor. If I run the below sql, it gives output:
    SELECT *
      FROM test_user
    WHERE catsearch (first_name, 'Supervisor', NULL) > 0;
    FIRST_NAME                     LAST_NAME
    Supervisor                     upervisor
    --even the below sql with wild card (*) at the end works fine...
    SQL> SELECT *
      2    FROM test_user
      3   WHERE catsearch (first_name, 'Super*', NULL) > 0;
    FIRST_NAME                     LAST_NAME
    Supervisor                     upervisor
    However the below sql queries doesn't give any output, though they should return the same row as above!
    SQL> SELECT *
      2    FROM test_user
      3   WHERE catsearch (first_name, '*visor', NULL) > 0;
    no rows selected
    SQL> SELECT *
      2    FROM test_user
      3   WHERE catsearch (first_name, '*vis*', NULL) > 0;
    no rows selected
    --Using query template as below solves the issue:
    select * from test_user
    where catsearch(first_name,
    '<query>
      <textquery grammar="context">
         %viso%
      </textquery>
    </query>','')>0
    FIRST_NAME                     LAST_NAME
    Supervisor                     upervisor
    Note that I verified the query execution plan and it uses the index and there is no Full Table Scan:
    | Id  | Operation                   | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                |       |       |     9 (100)|          |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEST_USER      |   376 |    99K|     9   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | TEST_USER_IDX3 |       |       |            |          |
    ---------------------------------------------------------------------------------------------- Up to the above , all details were by way of the back ground...now the question is - it is this the right choice? I am using context grammer using query template. There is another thread on this forum where an expert (Barbara) said that
    ". It should be better to use a context index than a ctxcat index with a query template that uses context grammar. " -this was said on this question link: Re: Wildcard Search
    So I am getting this doubt. However I have good data here that shows that the query doesn't do full table scan - still is it a bad choice? Note that there are several issues with CONTENT type of indexes( as per my limited understanding) - because they are not transactional in nature and so we have to take extra steps/measures to have the indexes updated which seems like a major pain area to me.
    My doubt is , did I do the right thing by using query template or should I use the CONTEXT type of index instead of CTXCAT type of index?
    Thanks,
    Nirav
    Edited by: orausern on Jan 17, 2013 1:40 AM
    Edited by: orausern on Jan 17, 2013 1:43 AM

    I would just like to add a few comments.
    Alhough it is documented that the ctxcxat index and catsearch do not support a wildcard in front of the term, a workaround is to use two asterisks on the left side of the term, as demonstrated below. I provide this only for clarification and interesting trivia. I would still use a context index for various reasons.
    SCOTT@orcl_11gR2> CREATE TABLE TEST_USER
      2    (FIRST_NAME  VARCHAR2(64 CHAR))
      3  /
    Table created.
    SCOTT@orcl_11gR2> INSERT INTO test_user VALUES ('Supervisor')
      2  /
    1 row created.
    SCOTT@orcl_11gR2> CREATE INDEX TEST_USER_IDX
      2  ON TEST_USER (FIRST_NAME)
      3  INDEXTYPE IS CTXSYS.CTXCAT
      4  /
    Index created.
    SCOTT@orcl_11gR2> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11gR2> SELECT * FROM test_user
      2  WHERE  catsearch (first_name, '**vis*', NULL) > 0
      3  /
    FIRST_NAME
    Supervisor
    1 row selected.
    Execution Plan
    Plan hash value: 4046491764
    | Id  | Operation                   | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |               |     1 |   142 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEST_USER     |     1 |   142 |     3   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | TEST_USER_IDX |       |       |            |          |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CATSEARCH"("FIRST_NAME",'**vis*',NULL)>0)
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2>The only time that I am aware of that there is a conflict between a wordlist and a lexer is when you specify stemming in both. If you are using stemming, you can still use both a wordlist and a lexer, but only set the stemmer attribute in the wordlist, not the index_stems attribute in the lexer.

Maybe you are looking for

  • Batch Spliting

    Hi, While making stock transfer of batch material I am getting this err.." Only 0.000 KG of material 10000020 0000000056 available" In Stock(MMBE) its showing 000000056    2.00  and                                           00000086     42.80 and i c

  • Yosemite slow, spinning beach ball at every action

    Description du problème : Yosemite worked well for a month or more, until yesterday. I used for the first time a flight simulator downloaded from appstore (for 30 minutes), i don't even know why i did that. After that mbp was really hot. At next star

  • HT1918 I've two account and I want to delete one of them and I want to change e-mail of my main account to the one which is my second account.

    Dear Apple Support, I've two Apple ID account. First account is my primary account with email is atichat39@*** is the Thai account. However, my secondary account I cant remember which country is US account and the email is chicky.viruz@***. The US ac

  • Customer data  report

    Hi experts if  i create Six Account group for customers and create customer with different company codes i want report to see all customer at a time in single report is it possible ? how?

  • Iweb go daddy .mac publishing - very confused

    Hiya, I know there is probably a thread out there that can help but I have spent hours looking and nothing seems to be solving my problem. I have bought a domain name from go daddy, parked it (didn't purchase a host as I want .mac to be my host). I h