Oracle text index - unexpected behavior

We have a SEARCH_TABLE (in Oracle 12.1.0.1.0) with a couple of files (actually about 10,000,000 records):

ID ADDRESS

1     | WIMPEL | 57. 9733BK | GRONINGEN |

2     | JOHAN WILSSTRAAT | 7 ||| 1333PV | ALMERE |

3     | ABRAHAM KUYPERHOF | 10. 8091XN | WEZEP |


To support research on the table addresses, we apply an Oracle text index:

create index ST_CTX1 on SEARCH_TABLE (address)

indexType is ctxsys.context

parameters ("DATASTORE CTXSYS. DEFAULT_DATASTORE');


Our research focuses on whole words (without jokers). When searching through the data, it usually comes back with the correct results.


SELECT THE ID

OF SEARCH_TABLE

WHERE CONTAINS (ADDRESS, 'GRÖNING') > 0

;

Returns nothing, that is correct. Once the search argument 'GRÖNING' is replaced by 'GRONINGEN', ID 1 is correctly selected. According to this behavior, the following query returns no records:

SELECT THE ID

OF SEARCH_TABLE

WHERE CONTAINS (ADDRESS, 'ABR & KUYPERHOF') > 0

;


Surprisingly, however, the following query returns record ID 3:

SELECT THE ID

OF SEARCH_TABLE

WHERE CONTAINS (ADDRESS, ' A & KUYPERHOF ') > 0

;

(Even if data does not contain the complete word 'A'). This unexpected behavior only seems to occur when you use "A" as the initial character.

The following query (with the search starting with the character 'J' argument) returns no data. Which is the expected behavior.

SELECT the ID

OF SEARCH_TABLE

WHERE CONTAINS (ADDRESS, 'J & WILSSTRAAT') > 0

;

Anyone has an idea why the text index returns with A situations? Any ideas on how to solve this problem are appreciated.

Mark

According to the list of empty words by default in 11.2, the letters a, d, i, s, and t are listed, so would be removed from the wanted list of tokens.  Thus, 'A & WILSSTRAAT' becomes '& WILSTRAAT' and search text line with a single word.  'j' is not an empty word, so it is considered to be a token is valid and is not in your tables.  Look in CTXSYS. CTX_STOPWORDS to see what you have.

Tags: Database

Similar Questions

  • All parameter memory index for Oracle text indexes

    Hi Experts,

    I'm on Oracle 11.2.0.3 on Linux and have implemented Oracle Text. I'm not an expert in this area and need help on a question. I created the Oracle text index with the default setting. However, in a white paper of oracle, I read that the default setting is perhaps not good. Excerpt from the white paper by Roger Ford:

    URL:http://www.oracle.com/technetwork/database/enterprise-edition/index-maintenance-089308.html

    "(Part of this white paper below. )" ...)

    Index memory as mentioned above, $I entries cached emptied out on the disk each time the indexing memory is exhausted. The default index to installing memory is a simple 12MB, which is very low. At the time of creating indexes, users can specify up to 50 MB, but it is still quite low.                                   

    This would be by a CREATE INDEX, something like statement:

     CREATE INDEX myindex ON mytable(mycol) INDEXTYPE IS ctxsys.context PARAMETERS ('index memory 50M');  

    Allow index of the parameters of memory beyond 50 MB, the CTXSYS user must first of all increase the value of the MAX_INDEX_MEMORY parameter, like this:

     begin ctx_adm.set_parameter('max_index_memory', '500M'); end;  

    The parameter memory must never be high point causes paging, because this will have a serious effect on indexing speed. The smallest of dedicated systems, it is sometimes advantageous to temporarily reduce the amount of memory consumed by the Oracle SGA (for example by reducing DB_CACHE_SIZE and/or SHARED_POOL_SIZE) during the index creation process. Once the index has been created, the size of the SGA can be increased again to improve query performance. & quot;

    (End of the excerpt from the white paper)


    My question is:

    (1) to apply this procedure (ctx_adm.set_parameter) obliged me to log on as user CTXSYS. Is this fair? or can it be avoided and will be based on the application schema? The CTXSYS user is locked by default and I had to unlock it. Is this OK to do it in production?

    (2) what value I should use for the max_index_memory there are 500 MB - my SGA is 2 GB in Dev / QA and / 3 GB in the production. Also in the creation of the index which is the value should I set for the parameter memory index - I had left to default, but how do I change now? Should it be 50 MB as shown in the example above?

    (3) the white paper also refer to the reconstruction of an index to an interval like once a month: ALTER INDEX DR$ index_name$ X REBUILD online;

    -Is this good advice? I would like to ask the experts once before doing this.  We are on Oracle 11 g and the white paper was drafted in 2003.

    Basically, while I read the book, I'm still not clear on many aspects and need help to understand this.

    Thank you

    OrauserN

    Index entries are built in memory, and then flushed to disk, memory is exhausted. With a setting of high index memory will mean the index entries can be longer and less fragmented, which provides better performance of the query.  Conversely, a small memory parameter index will mean emptied the disk pieces are smaller, so queries (especially on common words) will have to do a lot more e/s to extract several pieces of index for the words.

  • Oracle Text Index

    Hi all

    I have a question about the Oracle text Index:

    The used Oracle text index after entering data in the CLOB column or before? or anytime.


    CREATE the INDEX Ora_TXT_Index_ON_Test ON te1 (name) INDEXTYPE IS CTXSYS. CONTEXT;

    EXEC DBMS_STATS. GATHER_TABLE_STATS (waterfall of the USER 'TE1' = > TRUE);

    concerning

    Hello
    a text index is not used in the normal way. You must use a clause in your SQL statement that is looking for your text by using the keyword Index of contains. An Oracle text Index will be refreshd of way manual or if you specify validation to your index.

    Perhaps this links help
    http://Oracle-text-de.blogspot.co.at/2008/06/scoring-MIT-Oracle-text.html
    http://docs.Oracle.com/CD/B19306_01/text.102/b14218/cqoper.htm

    concerning
    Peter

  • Oracle Text Index rebuilt manually or automatically by DEFAULT

    For the following statement:

    "The Oracle * text (officially called Oracle and Oracle Intermedia context) utility allows us to analyze through a column of large text and indexes on the words in the column."

    Unlike the ordinary tree or bitmap index, index of context, ctxcat and ctxrule Oracle may be * set isn't content update is changed.* like most of Oracle databases will use with standard relational tables ctxcat index, you must decide on a refresh interval.  Oracle provides the SYNC operator for this.  The default value is SY ^ NC = MANUAL and you must manually synchronize the index with CTX_DDL. SYNC_INDEX.

    SYNC (MANUAL |) EACH interval 'string ' | ON VALIDATION)]

    «As a result, Oracle Text indexes are only useful for removing full table scans when tables are read-only in large part and/or end users don't mind not having 100% search reminder»

    -My question: the statement above claims: "Oracle indexes context, ctxcat and ctxrule can be configured to not update the content is changed. '." " Then what is the default setting for updating the index, manual or automatic? For example:

    First of all, I created an index like this: create index users_address_idx on users (address) indextype is ctxsys.ctxcat;

    Then, I made a few changes on the table such that change the values of the column address for several lines.

    The Oracle system will rebuild the ctxcat index automatically?

    What does the ' default is SY ^ NC = MANUAL "as shown in the quote?


    Thank you for helping.

    Scott

    scottjhn wrote:
    This source: http://www.dba-oracle.com/oracle_tips_like_sql_index.htm States:

    All first upward, please do not use the Web sites which present only part of the information and instead to advertise their services.

    -My question: the statement above claims: "Oracle indexes context, ctxcat and ctxrule can be configured to not update the content is changed. '." " Then what is the default setting for updating the index, manual or automatic? For example:

    First of all, I created an index like this: create index users_address_idx on users (address) indextype is ctxsys.ctxcat;

    Then, I made a few changes on the table such that change the values of the column address for several lines.

    The Oracle system will rebuild the ctxcat index automatically?

    No, the deafult is SYNC = MANUAL
    http://docs.Oracle.com/CD/B28359_01/text.111/b28304/csql.htm#CIHGAAFI
    >

    What does the ' default is SY ^ NC = MANUAL "as shown in the quote?

    This means that the need for the Index to synchronize manually
    http://docs.Oracle.com/CD/B28359_01/text.111/b28304/cddlpkg.htm#i998469

  • Oracle Text Index add to Stop List

    Hi all

    I have an Oracle (CTXCAT) Index of text on my Oracle 10 g Standard Edition.
    I also have a stop for the tokens in this index list.
    Now, I want to add a few empty words more to the stop list.
    Please guide me...


    Thanks and greetings
    Alexander gelin

    I think you can do optimization for your specific token token for the Index Rebuild, so no need to fast/full optimization.

    alter index myidx rebuild parameters ('OPTIMIZE TOKEN ORACLE');
    
    OR
    
    begin
      ctx_ddl.optimize_index('myidx','token', TOKEN=>'Oracle');
    end;
    

    If you are not attending the transactions on the base table, you can even synchronize the index rebuild.

    alter index myidx parameters ('SYNC 2M');
    
    OR
    
    begin
    ctx_ddl.sync_index('myindex', '2M');
    end;
    
  • ORACLE TEXT INDEX ON COLUMN VARCHAR2

    Hi all
    I find a search in our application very slow so I thought using ORACLE TEXT CTXCAT index based search but I find some inconsistencies. How can this be avoided... The following query should not return if I can replace with the text of the oracle, but I find few values... why result... I also gave some results of the sample below...

    SELECT first_name
    Of uc_partner_ms
    WHERE
    Upper (first_name) LIKE '% WIE % '.
    less
    SELECT first_name
    Of uc_partner_ms
    WHERE CATSEARCH (name,'* wie *', null) > 0

    RESULTS...

    Hans-Werner Mrowiec
    Heinz Oesterwiemann GmbH
    Helmut Froitzheim GmbH, Neuwied
    Heribert Schwies
    Hermann Twieling GmbH & Co. KG
    Breitwieser Horst
    Horst-Dieter Swie

    The script used to create indexes is

    Start
    ctx_ddl.create_preference ('mylex', 'BASIC_LEXER');
    ctx_ddl.set_attribute ('mylex', 'index_themes', 'NO');
    ctx_ddl.set_attribute ('mylex', 'mixed_case', 'NO');
    end;

    CREATE INDEX partner_index ON uc_partner_ms (first name)
    INDEXTYPE IS CTXSYS. CTXCAT
    parameters ('mylex LEXER');


    Where am I wrong that I couldn't guess a trend in the other that all results be lowercase...

    (1) what is the difference tag brings in the query?

    This is the QUERY MODEL, which allows you to use the CONTEXT GRAMMAR on the CTXCAT index, as if you were using CONTAINS. There are examples in the documentation here:

    http://download.Oracle.com/docs/CD/B19306_01/text.102/b14218/csql.htm#i1000002

    (2) is it a good idea to replace catsearch for like operator leader %?

    The wildcard character for a CATSEARCH operator on a CTXCAT index is the asterisk. The wildcard character for an operator CONTAINS a CONTEXT index is a percent sign. CATSEARCH does not support major wildcards, you can use a word followed by an asterisk, but not preceded by an asterisk. The percent sign is not a valid wildcard with CATSEARCH. However, when you use the query template and specify GRAMMAR = "CONTEXT". Then, it's as if you were using a CONTAINS operator with a CONTEXT index, so you can use a wildcard of beginning and the % sign is the wildcard character. You can use AS with signs of percentage before and after, but it is likely to be very slow, because it cannot use an index. If the main characters using generic is going to be a frequent requirement, then you would probably be better with a hint of CONTEXT with a BASIC_WORDLIST valued SUBSTRING_INDEX true for optimal speed.

    (3) also, I read in 10 g, the maximum number of rows returned is only 15000. is this true?

    N ° you probably read about the WILDCARD_MAXTERMS of 15,000 in 10 g limit. This is the maximum number of separate tokens (not lines) that can match a wildcard character without producing an error. In 11g the maximum is 50,000. The default values are lower. If you want to allow a large number of generic searches that match a large number of chips, then you probably assign the WILDCARD_MAXTERMS the most. However, there will always be some queries that are too general, you should plan to trap the error and returns a comprehensible message to your user, asking them that their search is too broad and to enter a value for more specific search.

  • (9.2.0.5.0) 9i - Oracle Text - Indexing of Oracle files on the FTP server

    I'm using Oracle 9i (9.2.0.5.0) and I cannot upgrade to a newer version of Oracle DB.
    I am new to this technology, and I have not tried it yet myself.

    I was reading some articles, documents or references on Oracle text technology and I find that Oracle text must be able to create an index of context on files residing on the FTP server.
    I also discovered that, for this purpose, a 'URL_DATASTORE' should be used.

    I'd be happy if someone can answer my question before I decide to start using this technology:
    Is there a limitation that I should be informed when creating index of context on files residing on the FTP server? (file size limit, limitation of the types of files supported)
    -In the creation of the index process are the files indexed, downloaded and copied in the Oracle database permanently or only temporarily until the index is created?
    -Everything is of incremental indexing (when I add new files in the data store that I don't have to rebuild the entire index)?
    There there a formula between context index disk size and the disk size indexed files?

    Kind regards

    Michal

    Is there a limitation that I should be informed when creating index of context on files residing on the FTP server? (file size limit, limitation of the types of files supported)
    Maximum file size is configurable up to 2 GB. No limitation on the file type from the data store itself, but if you want to process binary file list filter suported file formats will apply (see the appendix in the Administrator's guide)

    -In the creation of the index process are the files indexed, downloaded and copied in the Oracle database permanently or only temporarily until the index is created?
    That temporarily

    -Everything is of incremental indexing (when I add new files in the data store that I don't have to rebuild the entire index)?
    The question, I suspect that you see this as a robot - you expect to provide the address of an FTP site and have it look for all documents. This isn't how it works. Instead, you must place all of the URLS in a table, and text will index these URLS (and only these URLs)

    If new files are added, you must reorganize somehow having the new lines added to your table. Then the text will do an incremental update, it will not have to rebuild the entire index.

    There there a formula between context index disk size and the disk size indexed files?
    It varies a lot depending on the data types and indexing of selected options, but a typical result is that the index will be 40% of the total size of the file. However, if the documents are in the format (for example, Word, PDF) the percentage will be much smaller.

  • Oracle text index does not return the expected results.

    Hello

    My project requires a generic search on 5 different columns and all the VARCHAR2 data type.
    As performance is very slow with AS % search, I try to use for the multi_column_datastore that is recommended for this.

    Here's what I did.

    1 - Create table.
    CREATE TABLE BILLING_SCHEMA.NAMES_TABLE ( 
        ID                  NUMBER(9,0) NOT NULL,
        ENTITY_NUMBER         VARCHAR2(30) NOT NULL,
        GIVEN_NAMES         VARCHAR2(50) NULL,
        SURNAME             VARCHAR2(30) NULL,
        ORGANISATION_NAME     VARCHAR2(60) NULL,
        DISPLAY_NAME        VARCHAR2(100) NULL 
        )
    /
    
     
    My search must be made on the columns ENTITY_NUMBER, GIVEN_NAMES, surname, ORGANISATION_NAME and DISPLAY_NAME.

    2. - insert values into the table
    INSERT INTO NAMES_TABLE VALUES(1, 'GH', NULL, NULL, NULL, 'GROUP OF HOSPITAL')
    /
    INSERT INTO NAMES_TABLE VALUES(2, 'DH', NULL, NULL, NULL, 'DEPARTMENT OF HEALTH')
    /
    INSERT INTO NAMES_TABLE VALUES(3, 'REC', NULL, NULL, NULL, 'DEBTOR FOR RECEIPTS')
    /
    INSERT INTO NAMES_TABLE VALUES(4, 'UN_REC', NULL, NULL, NULL, 'DEBTOR FOR UNMATCHED RECEIPTS')
    /
    INSERT INTO NAMES_TABLE VALUES(5, 'SAM_FUND', NULL, NULL, NULL, 'THE S FUND')
    /
    
     
    3 - create context multi_column_datastore index
    BEGIN
    CTX_DDL.CREATE_PREFERENCE('NAMES_TABLE_MULTI', 'MULTI_COLUMN_DATASTORE');
    CTX_DDL.SET_ATTRIBUTE('NAMES_TABLE_MULTI', 'COLUMNS', 'ENTITY_NUMBER, GIVEN_NAMES, SURNAME, ORGANISATION_NAME, DISPLAY_NAME');
    END;
    
    CREATE INDEX NAMES_TABLE_IDX
    ON NAMES_TABLE(ENTITY_NUMBER)
    INDEXTYPE IS   CTXSYS.CONTEXT
    PARAMETERS ('DATASTORE NAMES_TABLE_MULTI')
    
     
    4 - create the trigger that should update the column ENTITY_NUMBER if everything is inserted/updated
    CREATE OR REPLACE TRIGGER NAMES_TABLE_TRIGGER
    BEFORE INSERT OR UPDATE OF GIVEN_NAMES, SURNAME, ORGANISATION_NAME, DISPLAY_NAME  ON NAMES_TABLE
    FOR EACH ROW
    BEGIN
      :NEW.ENTITY_NUMBER := :NEW.ENTITY_NUMBER;
    END
     
    5. the search query
    SELECT *
    FROM NAMES_TABLE
    WHERE  CONTAINS(ENTITY_NUMBER,'%TH%') > 0
     
    I am so very confused here because the result returned is only
    ID     ENTITY_NUMBER     GIVEN_NAMES     SURNAME     ORGANISATION_NAME     DISPLAY_NAME         
     2      DH                  (null)        (null)         (null)          DEPARTMENT OF HEALTH 
     
    When I wait for him that the 5th inserted record is returned too as it contains "THE S FUND" that begins with "TH".

    When I use the search string '% %' and %, no results are returned, although I expect at least two records in each case.

    I would appreciate help with this.

    Thanks in advance,
    Marilyn

    Published by: user5615580 on 08/03/2011 21:35

    Published by: user5615580 on 08/04/2011 16:33
  • Error while creating or rebuilding Oracle text Lexer keyword index

    Hi all
    I am getting following error when I create oracle text indexes using lexer & keyword in the list of stopwords.
    Please help me if any body know.
    Thanks in advance.


    Error from the 1 in the command line:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)

    Post INDEXTYPE IS "CTXSYS. "" (LOCAL) CONTEXT.
    PARTITION SETTINGS "BEFORE_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q1_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q2_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q3_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q4_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q1_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q2_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q3_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q4_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q1_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q2_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q3_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q4_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "THE_REST' ('LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)')
    )
    Error in the command line: 1 column: 13
    Error report:
    SQL error: ORA-29855: error when executing routine ODCIINDEXCREATE
    ORA-20000: Oracle text error:
    DRG-11000: invalid keyword LEXER
    ORA-06512: at "CTXSYS. DRUE", line 160
    ORA-06512: at "CTXSYS. TEXTINDEXMETHODS', line 365
    29855 00000 - "an error occurred in the execution of routine ODCIINDEXCREATE.
    * Cause: Cannot run the ODCIIndexCreate routine.
    * Action: Check if the routine was coded correctly.


    Kind regards
    Jack R.

    Hello

    It works if you put a clause of additional PARAMETERS to the end, so the creation looks like:
    CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
    INDEXTYPE IS "CTXSYS. "" (LOCAL) CONTEXT.
    PARTITION SETTINGS "BEFORE_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q1_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q2_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q3_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q4_2007" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q1_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q2_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q3_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q4_2008" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q1_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q2_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q3_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "Q4_2009" ("LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)"),
    PARTITION SETTINGS "THE_REST' ('LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)')
    )
    PARAMETERS ('LEXER dd_lexer list of words EMPTY dd_stoplist SYNC (ON COMMIT)')<==>

    Hope this helps

    Herald tiomela

  • Oracle Text

    Hi gurus/masters.

    Please advise on Oracle Text? I search in google. But getting junk info. Is this feature is there in oracle?

    Concerning

    SA

    This is a change from what I previously provided, its replacement by the table and column names and values that you provided, so that if all goes well it will allow you to understand.  I have also provided the text results simple separate query of the procedure that uses it.  I have shown with a string of values and a unique value, you provided.

    Scott@orcl12c >-table:

    Scott@orcl12c > CREATE TABLE Entitlement_dnt

    2 (order_number VARCHAR2 (15),)

    3 customer_num VARCHAR2 (15).

    4 generic_product_name_ext VARCHAR2 (25).

    5 entitlement_ref_id VARCHAR2 (15).

    6 device_asset_id VARCHAR2 (15))

    7.

    Table created.

    Scott@orcl12c >-data:

    Scott@orcl12c > INSERT ALL

    2 INTO Entitlement_dnt VALUES ('1000345', '342345', ' laptop', '123', 'SDILK143')

    3 INTO Entitlement_dnt VALUES ('1000345', '543243', 'portable', '321', '341KLIDS')

    4 INTO Entitlement_dnt VALUES ('5430001', '342345', ' laptop', '123', 'SDILK143')

    5 SELECT * FROM DUAL

    6.

    3 lines were created.

    Scott@orcl12c > SELECT * FROM Entitlement_dnt

    2.

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID

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

    1000345 342345 123 SDILK143 laptop

    1000345 543243 portable 321 341KLIDS

    5430001 342345 123 SDILK143 laptop

    3 selected lines.

    Scott@orcl12c >-multi_column_datastore:

    Scott@orcl12c > START

    CTX_DDL 2. CREATE_PREFERENCE ("your_datastore", "MULTI_COLUMN_DATASTORE");

    CTX_DDL 3. SET_ATTRIBUTE

    4 ("your_datastore", "COLUMNS",

    5 "order_number customer_num, generic_product_name_ext, entitlement_ref_id, device_asset_id");

    6 END;

    7.

    PL/SQL procedure successfully completed.

    Scott@orcl12c >-extra column for indexing (optional):

    Scott@orcl12c > ALTER TABLE Entitlement_dnt Add (search_cols VARCHAR2 (1))

    2.

    Modified table.

    Scott@orcl12c >-text index Oracle using multi_column_datastore:

    Scott@orcl12c > your_index CREATE INDEX

    2 on Entitlement_dnt (search_cols)

    3 INDEXTYPE IS CTXSYS. FRAMEWORK

    4 SETTINGS ("your_datastore of the DATA store")

    5.

    The index is created.

    Scott@orcl12c >-simple queries:

    Scott@orcl12c > i_OpenSearchText VARIABLE VARCHAR2 (4000)

    Scott@orcl12c > EXEC: i_OpenSearchText: = 1000345, 342345, laptop, 123, SDILK143'

    PL/SQL procedure successfully completed.

    Scott@orcl12c > SELECT *.

    2 from Entitlement_dnt

    3 WHERE CONTAINS (search_cols, REPLACE (: i_OpenSearchText, ', 'AND' ')) > 0

    6 m

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

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

    1000345 342345 123 SDILK143 laptop

    1 selected line.

    Scott@orcl12c > EXEC: i_OpenSearchText: = '1000345'

    PL/SQL procedure successfully completed.

    Scott@orcl12c > SELECT *.

    2 from Entitlement_dnt

    3 WHERE CONTAINS (search_cols, REPLACE (: i_OpenSearchText, ', 'AND' ')) > 0

    6 m

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

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

    1000345 342345 123 SDILK143 laptop

    1000345 543243 portable 321 341KLIDS

    2 selected lines.

    Scott@orcl12c >-procedure that accepts the string of values separated by commas

    Scott@orcl12c >- and returns ref cursor using the query:

    Scott@orcl12c > prc_open_search CREATE OR REPLACE PROCEDURE

    2 (i_OpenSearchText IN VARCHAR2,

    3 o_result SYS_REFCURSOR to)

    4 AS

    5 BEGIN

    6 - slider Ref that uses Oracle Text query using wil Oracle text index:

    7 OPEN FOR o_result

    8. SELECT *.

    9 OF Entitlement_dnt

    10 WHERE CONTAINS (search_cols, REPLACE (i_OpenSearchText, ', 'AND')) > 0;

    11 END prc_open_search;

    12.

    Created procedure.

    Scott@orcl12c > SHOW ERRORS

    No errors.

    Scott@orcl12c >-execution:

    Scott@orcl12c > g_ref VARIABLE REFCURSOR

    Scott@orcl12c > START

    2 prc_open_search

    3 (i_OpenSearchText-online 1000345, 342345, laptop, 123, SDILK143',)

    4 o_result =>: g_ref);

    5 END;

    6.

    PL/SQL procedure successfully completed.

    Scott@orcl12c > g_ref PRINT

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

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

    1000345 342345 123 SDILK143 laptop

    1 selected line.

    Scott@orcl12c > START

    2 prc_open_search

    3 (i_OpenSearchText-online '1000345',

    4 o_result =>: g_ref);

    5 END;

    6.

    PL/SQL procedure successfully completed.

    Scott@orcl12c > g_ref PRINT

    ORDER_NUMBER CUSTOMER_NUM GENERIC_PRODUCT_NAME_EXT ENTITLEMENT_REF DEVICE_ASSET_ID S

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

    1000345 342345 123 SDILK143 laptop

    1000345 543243 portable 321 341KLIDS

    2 selected lines.

  • Performance issues and options to reduce the loading with the Oracle text implementation

    Hi Experts,

    My database on Oracle 11.2.0.2 on Linux. We have Oracle implemented for the fuzzy search. Our oracle text indexes are defined as sync on commit that we cannot afford to have stale data.  Now our application done literally thousands of inserts/modifications/deletions of these columns where we have these Oracle text index defined. Thus, we see a significant impact on performance because the oracle text synchronization routines is called on each commit. We do nightly index optimization (optimization full every night at 3:00).  The text index oracle internal operations are appearing at the top of the sql page in our AWR report and fears it causes a lot of load on the DB.  Since we do optimization of the complete index once during the night, I think I should change that, and if I do, he's going to help us?

    For example, here are some data of AWR report my one day:

    Time elapsed (s) Executions Time by Exec (s) % Total % CPU %IO SQL ID SQL module SQL text
    27,386.25305 4410.0916.5015.829.98ddr8uck5s5kp3Start ctxsys.drvdml.com_sync_i...
    14,618.81213 9800.078.818.3927.7902yb6k216ntqfbegin ctxsys.syncrn (: idxownid,...)


    More top sql full text:

    ddr8uck5s5kp3begin ctxsys.drvdml.com_sync_index (: idxname,: idxmem,: partname);
    end
    02yb6k216ntqf

    begin ctxsys.syncrn (: idxownid,: idxoname,: idxid,: ixpid,: rtabnm,: flg); end;

    Now if I do optimization of the complete index that more often, and not only once night 15:00 will be this average, the load on DB sync on commit will decrease? If Yes, how many times should I optimized and the optimization itself does not lead to a load? Can anyone suggest?

    Thank you

    OrauserN

    It's to you which values you want to experiment.  Since 1 G, which is the same as 1024M is the maximum I could try that assigning to an index and see what effect it has.  You can use the same AWR report that you used previously and compare performance.  To determine when paging depends on your operating system and what tools you have.  Another option might be to use TRANSACTIONAL, that allows searching for unsynchronized lines and allow you to synchronize every five minutes, like Herald suggested, without any latency problem.  You can read about it here (scroll down to transaction):

    http://docs.Oracle.com/CD/E11882_01/text.112/e24436/csql.htm#CCREF23731

  • The text index can do for me?

    Hi all

    I have the following question to und of the oracle text index requirements:
    I saved in the VARCHAR2 column some channels:
    CREATE TABLE t1
    (STR VARCHAR2(200));
    
    INSERT INTO t1 (STR)
    VALUES ('Abcd');
    
    INSERT INTO t1 (STR)
    VALUES ('abcd');
    
    INSERT INTO t1 (STR)
    VALUES ('Aabcd');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcd-ef');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcd ef');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcd - ef');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcd - 12');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcd_ef12');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcdef');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcdgh');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcdij');
    
    INSERT INTO t1 (STR)
    VALUES ('Abcdklmnop');
    
    COMMIT;
    Then I create an index of text with the following script:
    BEGIN
      CTX_DDL.CREATE_PREFERENCE('SUBSTR_PREF','BASIC_WORDLIST');
      CTX_DDL.SET_ATTRIBUTE('SUBSTR_PREF','SUBSTRING_INDEX','TRUE');
    
      CTX_DDL.CREATE_PREFERENCE('pj_lex', 'BASIC_LEXER');
      CTX_DDL.SET_ATTRIBUTE('pj_lex', 'PRINTJOINS', '-');
      
      CTX_DDL.CREATE_PREFERENCE('mcds_t1_str', 'MULTI_COLUMN_DATASTORE');
      CTX_DDL.SET_ATTRIBUTE('mcds_t1_str', 'COLUMNS', '''XZX''||STR');
    END;
    /
    
    CREATE INDEX IDX_T1_STR ON T1
    (STR)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('wordlist  SUBSTRING_PREF
                LEXER     pj_lex
                DATASTORE mcds_t1_str
                memory    50m')
    NOPARALLEL;
    My requirements are: when I look for "abcd" (WHERE contains (STR, "Frederick" |: var1 |)) » %') > 0) :
    I should get: Abcd, abcd, Abcd-ef, ef Abcd, Abcd - ef, Abcd - 12, Abcd_ef12, but not Abcdef*, Abcdgh*, *Abcdij*, Abcdklmnop*, Aabcd*.

    The search text must begin with "abcd" (case sensitive), after "abcd", he must have 1 or more characters that start with test blank, '-', '_', or any other special characters, but should not begin with a letter.

    Is it possible to do this with the oracle text index?

    Concerning

    S Max wrote:
    Hi, thanks!
    Is it possible to the value ' * ' as PRINTJOINS and SKIPJOINS?

    Of course, everything is in the base lexer:

    INSERT INTO t1 (STR)
    VALUES ('Abcd*ef');
    
    BEGIN
      CTX_DDL.DROP_PREFERENCE('SUBSTR_PREF');
      CTX_DDL.DROP_PREFERENCE('pj_lex');
    end;
    
    drop INDEX IDX_T1_STR
    
    CREATE INDEX IDX_T1_STR ON T1
    (STR)
    INDEXTYPE IS CTXSYS.CONTEXT
    
    select *
    from t1
    where
    contains (str,'abcd') > 0
    
    STR
    Abcd ef
    Abcd
    abcd
    Abcd-ef
    Abcd - ef
    Abcd - 12
    Abcd_ef12
    Abcd*ef 
    

    But you don't do this with XYZ as a prefix and a wild card.

  • Oracle Text corresponds to unexpected lines

    Hi people:

    I use Oracle Text in Oracle 12 c to search the text for a column that is indexed as follows:

    We will examine these lines.

    • Table X
    Text
    90-SE
    90-BA
    Hello

    I want to search the text "90-SE", then I did the following SQL query:

    SELECT TEXT, SCORE (1)

    X

    WHERE CONTAINS (TEXT, '90\ - SE', 1) > 0;

    The result is:

    Score (1) TEXT
    590-SE
    590-BA

    I can't understand why it is corresponding to the line containing 90-BA.

    Thank you

    ytor

    I am unable to reproduce your error, but I do not know what lexer attributes and others you may have.  I don't know if you are aware that unless you set the hyphen as a printjoin it is not indexed.  Please see the demo below, noting the differences in the token_text.

    Scott@ORCL > select version banner $ v

    2.

    BANNER

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

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

    PL/SQL Release 12.1.0.2.0 - Production

    CORE Production 12.1.0.2.0

    AMT for 64-bit Windows: Version 12.1.0.2.0 - Production

    NLSRTL Version 12.1.0.2.0 - Production

    5 selected lines.

    Scott@ORCL > create table x

    2 (text varchar2 (60))

    3.

    Table created.

    Scott@ORCL > insert all

    2 in the x values (90-SE "")

    3 in x values (90-BA "")

    values ('Hello') x 4

    5 Select * of the double

    6.

    3 lines were created.

    Scott@ORCL > create index x_text_idx on x (text)

    2 indextype is ctxsys.context

    3.

    The index is created.

    Scott@ORCL > select Dr. token_text $ x_text_idx$ I

    2.

    TOKEN_TEXT

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

    90

    BA

    Hello

    IS

    4 selected lines.

    Scott@ORCL > SCORE (1) SELECT, TEXT

    2 X

    3. WHERE CONTAINS (TEXT, '90\ - SE', 1) > 0

    4.

    SCORE (1) TEXT

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

    4 90-SE

    1 selected line.

    Scott@ORCL > start

    2 ctx_ddl.create_preference ('test_lex', 'basic_lexer');

    3 ctx_ddl.set_attribute ('test_lex', 'printjoins', '-');

    4 end;

    5.

    PL/SQL procedure successfully completed.

    Scott@ORCL > drop index x_text_idx

    2.

    The index is deleted.

    Scott@ORCL > create index x_text_idx on x (text)

    2 indextype is ctxsys.context

    3 parameters ("lexer test_lex")

    4.

    The index is created.

    Scott@ORCL > select Dr. token_text $ x_text_idx$ I

    2.

    TOKEN_TEXT

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

    90-BA

    90-SE

    Hello

    3 selected lines.

    Scott@ORCL > SCORE (1) SELECT, TEXT

    2 X

    3. WHERE CONTAINS (TEXT, '90\ - SE', 1) > 0

    4.

    SCORE (1) TEXT

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

    4 90-SE

    1 selected line.

  • Oracle Text, create index (indextype is ctxsys.context)

    Dear Sirs,

    I am a new user of text Oracle (Oracle 11 g release 11.2) and I'm unable to create an index of type ctxsys.context). Any suggestions? :

    Code:
    drop table mytable;
    drop index myindex force;
    create table mytable (id number primary key, docs clob);

    insert into mytable values (111555, "this text will be indexed '");
    insert into mytable values (111556, "it is an example of default data store");
    commit;

    create index myindex on mytable (docs)
    indexType is ctxsys.context
    parameters ("DATASTORE CTXSYS. DEFAULT_DATASTORE');
    +++++++
    error messages:
    create index myindex on mytable (docs)
    *
    ERROR on line 1:
    ORA-29855: an error has occurred in the execution of routine ODCIINDEXCREATE
    ORA-20000: Oracle text error:
    ORA-06508: PL/SQL: called program unit is not found
    ORA-06512: at "CTXSYS. DRUE", line 160
    ORA-06512: at "CTXSYS. TEXTINDEXMETHODS', line 366

    Please check for invalid objects. Connect as sys or system and run:

    Select object owner, object_name, object_type where status = 'INVALID ';

    View the results here and we will advise the next step.
    If all the objects owned by CTXSYS are not valid, you will need to recompile the schema CTXSYS.

  • Text index CONTEXT Oracle which gives bad results!

    Expert Oracle Text,

    I'm on Oracle 11.2.0.2 on Solaris 10 and have implemented the Oracle text features using the CONTEXT index type, and I'm getting a few problems in. I have a need for research with joker as % and giving the wrong exit. Here's the scenario where I get incorrect results:
     
    
    --creating preferences etc 
    exec   ctxsys.ctx_ddl.create_preference ('cust_lexer', 'BASIC_LEXER'); 
    exec   ctxsys.ctx_ddl.set_attribute ('cust_lexer', 'base_letter', 'YES'); -- removes diacritics 
    exec   ctxsys.ctx_ddl.create_preference ('cust_wl', 'BASIC_WORDLIST') 
    exec   ctxsys.ctx_ddl.set_attribute ;    ('cust_wl', 'SUBSTRING_INDEX', 'true'); 
    
    --table set up 
    CREATE TABLE TEST_USER 
    ( 
      FULL_NAME  VARCHAR2(64 CHAR)                  NOT NULL, 
      LAST_NAME  VARCHAR2(64 CHAR)                  NOT NULL 
    ); 
    
    
    CREATE INDEX TEST_USER_IDX5 ON TEST_USER 
    (FULL_NAME) 
    INDEXTYPE IS CTXSYS.CONTEXT 
    PARAMETERS('LEXER cust_lexer WORDLIST cust_wl SYNC (ON COMMIT)'); 
    
    --data set up 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Supervisor upervisor', 'upervisor'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('JOSEPH WILSON', 'WILSON'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('CHRISTOPHER Phil', 'TAYLOR'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('PAUL HERNANDEZ', 'HERNANDEZ'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Betty Jipes', 'Jones'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('One Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Three Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Two Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Four Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Gary Barrow', 'Barrow'); 
    COMMIT; 
    
    --query using CONTAINS which gives WRONG output - because out intention is to return only those strings that START WITH the letter P but it returns another string that has P not at the starting!! 
    
    SQL> select full_name from test_user where contains(full_name,'P%')>0; 
    
    FULL_NAME 
    ---------------------------------------------------------------- 
    PAUL HERNANDEZ 
    CHRISTOPHER Phil 
    
    -- I need output as follows in which the second value is not returned...meaning 'CHRISTOPHER Phil' should NOT be returned by the CONTAINS clause just as the LIKE operator below doesn't return it. 
    SQL> select full_name from test_user where full_name like 'P%'; 
    
    FULL_NAME 
    ---------------------------------------------------------------- 
    PAUL HERNANDEZ 
    Please can anyone suggest what to do about it?

    Thank you
    OrauserN

    No, you can skip all those, if you use SUBSTRING_INDEX.

Maybe you are looking for