Oracle text for varchar2

Hi ...
can i use oracle Text for searching in varchar2 field ....
IF yes , plz give me the details ....
Thanks ....

SELECT OD OID, TAB Layer, COLUM Field, TEX Result,
score(22) Score FROM VIEW_MASTER
WHERE CONTAINS ( TEXT_VALUE, SEARCH_TERMS, 22 ) > 0
ORDER BY Score;
The search_terms are an inbound parameter. Not sure
what the 22 does, i think its just an alias name. I
don't know what the score coming back means.
Sometimes I get 16, sometimes 12, sometimes 7.
I could use some help on this myself.Yes, 22 is just an alias. You can use any number here since it is just a label which is used to correlate the CONTAINS function with its corresponding SCORE function.
The details of how the score is computed are available in the Oracle Text Reference book, Appendix "F The Oracle Text Scoring Algorithm".
Faisal

Similar Messages

  • Configuring Oracle Text for 10g

    Hello,
    Sorry, it this sounds like such a newbie question, but is there is a simple guide to the basic configuration and setup of Oracle Text for 10g?
    Thank you for your help.

    Hi,
    Check out note 280713.1. You can verify your install and install manually if necessary.
    If you haven't done anything with the db (created schemas/objects) it might actually be easiest to simply delete the db and create a new one. Just make sure when you do that you select 'custom' from the list of templates and then choose Oracle Text as one of the options.
    Thanks,
    Ron

  • Oracle text for italian language document

    How i can set Oracle Text index to index an italian text field.
    How can i set the right stop_list, lexer, .....
    Thanks

    I believe if your NLS_LANG settings are set appropriately for Italian, it should automatically use the proper defaults for Italian in a text index.

  • Oracle Text for Traditional Chinese

    I would like to ask how can i specific keywords in Chinese and whenever i type sometimes in Chinese, the Oracle Text's token is indexed very interested and the stop word is definite not sometimes rational in Traditional Chinese. Anyone can help? (DR$xxx$I)

    You can specify a stoplist in Chinese. Please refer to the documentation for more information about the CTX_DDL.CREATE_STOPLIST procedure and for the Chinese lexer.

  • Using Oracle Text for searching with UCM 10g

    I am using Oracle text with UCM 10gR3 and Site Studio 10gR4 and I am trying to sort the search results by relevancy and to also include a snippet of the retrieved document. I have the fields that the SS_GET_SEARCH_RESULTS service returns but the relevancy score is always equals 5 and the snippet contains characters such as < idcnull, /p, etc., which you can see are XML/HTML/UCM tags but which result sin even more strangeness in the snippet if I try to remove them programmatically.
    I have read the Oracle Text documentation and there appear to be ways you can configure Oracle Text but I am not clear at all on what I can do from UCM. It looks like the configuration is either done in database tables or in the query itself, neither of which are readily configurable to me.
    Is anyone experienced in this or know of any documentation this might help?
    Bill

    Hi
    If I remember correctly then this issue was seen with an older version of OTS component and Core Update patch / bundle . Upgrade the UCM instance with the latest CS10gr35 update bundle patchset 6907073 and also upgrade OTS component from the same patchset .
    Let me know how it goes after this .
    Thanks
    Srinath

  • Using Oracle Text for Text Mining

    Hi all !
    I have 30000 text documents stored in a table and I want to construct a "dictionnary" that contains all the terms include in those documents. I will use this dictionnary to classify my documents with the text mining solutions of Oracle.
    I created an index with a multi datastore, specific lexer, stoplist and wordlist and it creates well my dictionnary. The problem is that I would like to add some other tokens containing more than a word. I wonder how to use the index created : I tried to work on the table $I created for the index but it's not really successful. So I thought about 2 solutions :
    - work on the index with insert, delete and synchronise operations
    - find a way to insert the additionnal tokens (which corresponds to pattern) during the indexing operation
    Can you help me ?
    Laetitia

    Hi,
    Check out a thesaurus (enter your phrases here) and see if it will do what you need:
    http://download-west.oracle.com/docs/cd/B19306_01/text.102/b14217/cthes.htm#i1006324
    Don't modify the $I table as a general rule (or any system-generated table).
    Thanks,
    Ron

  • Is Oracle Text the right solution for this need of a specific search!

    Hi ,
    We are on Oracle 11.2.0.2 on Solaris 10. We have the need to be able to do search on data that are having diacritical marks and we should be able to do the serach ignoring this diacritical marks. That is the requirement. Now I got to hear that Oracle Text has a preference called BASIC_LEXER which can bypass the diacritical marks and so solely due to this feature I implemented Oracle Text and just for this diacritical search and no other need.
    I mean I set up preference like this:
      ctxsys.ctx_ddl.create_preference ('cust_lexer', 'BASIC_LEXER');
      ctxsys.ctx_ddl.set_attribute ('cust_lexer', 'base_letter', 'YES'); -- removes diacritics
    With this I set up like this:
    CREATE TABLE TEXT_TEST
      NAME  VARCHAR2(255 BYTE)
    --created Oracle Text index
    CREATE INDEX TEXT_TEST_IDX1 ON TEXT_TEST
    (NAME)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('LEXER cust_lexer WORDLIST cust_wl SYNC (ON COMMIT)');
    --sample data to illustrate the problem
    Insert into TEXT_TEST
       (NAME)
    Values
       ('muller');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('müller');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('MULLER');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('MÜLLER');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('PAUL HERNANDEZ');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('CHRISTOPHER Phil');
    COMMIT;
    --Now there is an alternative solution that is there,  instead of thee Oracle Text which is just a plain function given below (and it seems to work neat for my simple need of removing diacritical characters effect in search)
    --I need to evaluate which is better given my specific needs -the function below or Oracle Text.
    CREATE OR REPLACE FUNCTION remove_dia(p_value IN VARCHAR2, p_doUpper IN VARCHAR2 := 'Y')
    RETURN VARCHAR2 DETERMINISTIC
    IS
    OUTPUT_STR VARCHAR2(4000);
    begin
    IF (p_doUpper = 'Y') THEN
       OUTPUT_STR := UPPER(p_value);
    ELSE
       OUTPUT_STR := p_value;
    END IF;
    OUTPUT_STR := TRANSLATE(OUTPUT_STR,'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
    RETURN (OUTPUT_STR);
    end;
    --now I query for which name stats with  a P%:
    --Below query gets me unexpected result of one row as I am using Oracle Text where each word is parsed for search using CONTAINS...
    SQL> select * from text_test where contains(name,'P%')>0;
    NAME
    PAUL HERNANDEZ
    CHRISTOPHER Phil
    --Below query gets me the right and expected result of one row...
    SQL> select * from text_test where name like 'P%';
    NAME
    PAUL HERNANDEZ
    --Below query gets me the right and expected result of one row...
    SQL>  select * from text_test where remove_dia(name) like remove_dia('P%');
    NAME
    PAUL HERNANDEZMy entire need was only to be able to do a search that bypasses diacritical characters. To implement Oracle Text for that reason, I am wondering if that was the right choice! More so when I am now finding that the functionality of LIKE is not available in Oracle Text - the Oracle text search are based on tokens or words and they are different from output of the LIKE operator. So may be should I have just used a simple function like below and used that for my purpose instead of using Oracle Text:
    This function (remove_dia) just removes the diacritical characters and may be for my need this is all that is needed. Can someone help to review that given my need I am better of not using Oracle Text? I need to continue using the functionality of Like operator and also need to bypass diacritical characters so the simple function that I have meets my need whereas Oracle Text causes a change in behaviour of search queries.
    Thanks,
    OrauserN

    If all you need is LIKE functionality and you do not need any of the complex search capabilities of Oracle Text, then I would not use Oracle Text. I would create a function-based index on your name column that uses your function that removes the diacritical marks, so that your searches will be faster. Please see the demonstration below.
    SCOTT@orcl_11gR2> CREATE TABLE TEXT_TEST
      2    (NAME  VARCHAR2(255 BYTE))
      3  /
    Table created.
    SCOTT@orcl_11gR2> Insert all
      2  into TEXT_TEST (NAME) Values ('muller')
      3  into TEXT_TEST (NAME) Values ('müller')
      4  into TEXT_TEST (NAME) Values ('MULLER')
      5  into TEXT_TEST (NAME) Values ('MÜLLER')
      6  into TEXT_TEST (NAME) Values ('PAUL HERNANDEZ')
      7  into TEXT_TEST (NAME) Values ('CHRISTOPHER Phil')
      8  select * from dual
      9  /
    6 rows created.
    SCOTT@orcl_11gR2> CREATE OR REPLACE FUNCTION remove_dia
      2    (p_value   IN VARCHAR2,
      3       p_doUpper IN VARCHAR2 := 'Y')
      4    RETURN VARCHAR2 DETERMINISTIC
      5  IS
      6    OUTPUT_STR VARCHAR2(4000);
      7  begin
      8    IF (p_doUpper = 'Y') THEN
      9        OUTPUT_STR := UPPER(p_value);
    10    ELSE
    11        OUTPUT_STR := p_value;
    12    END IF;
    13    RETURN
    14        TRANSLATE
    15          (OUTPUT_STR,
    16           'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ',
    17           'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
    18  end;
    19  /
    Function created.
    SCOTT@orcl_11gR2> show errors
    No errors.
    SCOTT@orcl_11gR2> CREATE INDEX text_test_remove_dia_name
      2  ON text_test (remove_dia (name))
      3  /
    Index created.
    SCOTT@orcl_11gR2> set autotrace on explain
    SCOTT@orcl_11gR2> select * from text_test
      2  where  remove_dia (name) like remove_dia ('mü%')
      3  /
    NAME
    muller
    müller
    MULLER
    MÜLLER
    4 rows selected.
    Execution Plan
    Plan hash value: 3139591283
    | Id  | Operation                   | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                           |     1 |  2131 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXT_TEST                 |     1 |  2131 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | TEXT_TEST_REMOVE_DIA_NAME |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('mü%'))
           filter("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('mü%'))
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select * from text_test
      2  where  remove_dia (name) like remove_dia ('P%')
      3  /
    NAME
    PAUL HERNANDEZ
    1 row selected.
    Execution Plan
    Plan hash value: 3139591283
    | Id  | Operation                   | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                           |     1 |  2131 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXT_TEST                 |     1 |  2131 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | TEXT_TEST_REMOVE_DIA_NAME |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('P%'))
           filter("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('P%'))
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2>

  • Process for Oracle Text

    am working as a dba and we plan to introduce oracle text for text search. since I am new to this concept, I would like to know step by step implementation of Oracle text. I've searched some web sites but still not clear on the implementation part.
    Please help me out

    Hi,
    Oracle Text is included in both standard and enterprise editions of the data server. When you are creating your database, select Oracle Text during configuration (one of the options). You will then have Oracle Text available on your database. The schema name is CTXSYS. You need to unlock this account just like any other.
    To use Text, either grant permissions on the specific objects you need for the user, or use the CTXAPP role. It is up to you to know the permissions required for the objects (in other words, I can't tell you your requirements), so research this in the reference manual.
    At this point, it is ready to use. Just create your indexes according to the Oracle Text Developer's Guide (you can find this with all of the documentation - look at the Application Developer's tab in Doc Library). Your search syntax depends totally on your requirements, and the type of index you choose to create. For example, the CONTEXT index uses the CONTAINS operator, and the CTXCAT index uses CATSEARCH (unless of course you want to use templates, but let's not go there just yet...).
    There are two references you will want to review: The Oracle Text Developer's Guide and the Oracle Text Reference.
    Hope this helps,
    Ron

  • Oracle Text with Numbers

    Hello,
    I need to search in a number column for particular "subnumbers". For
    example I have a column with 3453454 in it an I like to search e.g for the
    number "53" in it. I know I could use
    select * from table where number_column like '%53%'
    but since the table is rather big I'd like to use Oracle Text for it to avoid a full table scan and query like
    select * from table where contains(number_column, '53') > 0
    but above query would return NULL after converting the number column
    to a varchar2 column! Only full numbers are indexed and therefore only
    a search on the full number 3453454 would yield a result. What are my
    options to make above query with "contains" clause work?
    Thanks in advance

    You can configure Text to do substring searches.
    Do this:
    ctx_ddl.create_preference( 'SUBSTR_SUPPORT_PREF', 'basic_wordlist' );
    ctx_ddl.set_attribute( 'SUBSTR_SUPPORT_PREF', 'SUBSTRING_INDEX', 'YES' );
    Then you can do something like:
    where contains(col,'%53%',1) > 0
    Tom Best

  • Oracle Text omitting the words as, is, do, or etc in searches

    I am trying to do a search using Oracle Text for the country code for Dominican Republic and I get no hits back. This is also the case for some other countries: IS (Iceland), NO (Norway), IT (Italy). Here is my where clause:
    where contains(tablename, 'DO within country')
    Is there any workaround for this?

    Those words are stopwords, words that Oracle does not tokenize and index and are not searchable. If you do not specify a stoplist, then Oracle uses the default stoplist, that contains these words. If you use an empty stoplist or a stoplist that does not contain those words, then they are tokenized, inexed, and searchable. Please see the demonstration below that first recreates your situation, or something similar since I don't know what sort of section group you are using, then drops the index and recreates it using an empty stoplist, then shows that DO is tokenized, indexed, and searchable.
    SCOTT@10gXE> CREATE TABLE your_table
      2    (address   VARCHAR2 (30),
      3       country   VARCHAR2 (2),
      4       tablename VARCHAR2 (30))
      5  /
    Table created.
    SCOTT@10gXE> INSERT INTO your_table VALUES ('somewhere', 'DO', NULL)
      2  /
    1 row created.
    SCOTT@10gXE> EXEC CTX_DDL.CREATE_PREFERENCE ('my_multi', 'MULTI_COLUMN_DATASTORE')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> EXEC CTX_DDL.SET_ATTRIBUTE ('my_multi', 'COLUMNS', 'address, country')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> EXEC CTX_DDL.CREATE_SECTION_GROUP ('my_section_group', 'BASIC_SECTION_GROUP')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> EXEC CTX_DDL.ADD_FIELD_SECTION ('my_section_group', 'country', 'country')
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX your_index ON your_table (tablename)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS
      4    ('DATASTORE     my_multi
      5        SECTION GROUP my_section_group')
      6  /
    Index created.
    SCOTT@10gXE> SELECT token_text FROM dr$your_index$i
      2  /
    TOKEN_TEXT
    SOMEWHERE
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (tablename, 'DO WITHIN country') > 0
      3  /
    no rows selected
    SCOTT@10gXE> DROP INDEX your_index
      2  /
    Index dropped.
    SCOTT@10gXE> CREATE INDEX your_index ON your_table (tablename)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS
      4    ('DATASTORE     my_multi
      5        SECTION GROUP my_section_group
      6        STOPLIST CTXSYS.EMPTY_STOPLIST')
      7  /
    Index created.
    SCOTT@10gXE> SELECT token_text FROM dr$your_index$i
      2  /
    TOKEN_TEXT
    DO
    SOMEWHERE
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (tablename, 'DO WITHIN country') > 0
      3  /
    ADDRESS                        CO TABLENAME
    somewhere                      DO
    SCOTT@10gXE>

  • Oracle text stemmer  arabic

    hi for all
    i use oracle text for indexing arabic and english documents
    all are ok but stemer for arabic not work ?????
    i try all lexer but all not success to index arabic stemmer !!1
    any one can help me?
    and does oracle text support fuzzy search for language arabic ?
    note : i use oracle 11.0.2 g .
    thanks

    I'm not sure why you've got:
    ctx_ddl.set_attribute('mylex', 'index_stems', '8');It should be
    ctx_ddl.set_attribute('mylex', 'index_stems', 'YES');Arabic stemming in auto_lexer DOES work. I've successfully tested it in a PHP environment.
    It's not easy to do in SQL*Plus due to character set issues. It may be that what you think you're putting into the database is not what the stemmer thinks is in there.
    If "docs" is a VARCHAR2 column, then do:
    "select dump(docs) from test"
    and make sure that the characters you get back (in decimal form) are what you would expect given your character set settings.
    Also, no stemmer is perfect. They will not contain all possible stems for every word. Make sure you run your test with a variety of terms. I can't read Arabic, so have no idea of the terms you're using.
    You can look at the tokens in your index table as follows. To find all tokens with their token_type (generally, 0 for normal words, 9 for stems) do:
    select token_type, token_text, dump(token_text) from eq_test.dr$index_test$ii order by token_text;and to get just the stems:
    select token_type, token_text, dump(token_text) from eq_test.dr$index_test$i
           where token_type = 9
           and token_text not in
                 ( select token_text from eq_test.dr$index_test$i where token_type = 0 );

  • Oracle Text in TimesTen?

    If i have a ,lot of documents I am using Oracle Text for Indexing, are there any options to using TimesTen?

    TimesTen doesn't support Oracle Text directly.
    If caching is used then Text Searches are possible via a timesten client and executed on the Oracle  RDBMS database.

  • Saving queries executed in Oracle Text

    I am gathering information on Oracle Text for use as a text query capability. My users would like to be able to execute the same queries so would like the ability to save their query parameters. Is this available in Oracle Text?

    Yes - you can save queries as Stored Query Expressions.

  • Oracle Secure enterprise Search versus Oracle Text

    I'm involeved in a project where we're using Oracle text for its text search capability. Yesterday during a meeting Oracles Secure Enterprise search engine came up. I see similar functionality offered in both products - Oracle text comes with 10g - not sure if SES comes with additional cost. Has anyone done analysis on why one would implement one over the other - I understand that SES gives the customer a federated option and some internet search capabilities but since I'm not concerned with that for this project does it make a difference?

    SES is a complete seaerch application with connectors to many different data sources, such as email systems and document management systems.
    Oracle Text, on the other hand, is a toolkit for building applications (and is used as such by SES).
    Oracle Text comes free with the database. SES is chargable, but comes with a free database (though it's restricted to use by SES only!)
    Generally speaking, if your data is in the database and you want fine control over how to search it, Oracle Text is a better option.
    If your data is scattered around diverse enterprise sources, and you want a ready-built application to collect, index and search that data, SES is the proper choice.
    Here's a slide from my OpenWorld presentation, which I guess says much the same thing:
    Oracle Text is the toolkit and platform for building sophisticated Information Retrieval applications and services
    - Fine control over indexes, partitioning, etc
    Oracle Secure Enterprise Search is a stand-alone application built on the foundation of Oracle Text
    - Includes its own database
    - No programming needed
    - Includes crawlers and an end-user UI

  • Oracle Text with eBusiness Suite

    I'm trying to understand if Oracle eBusiness Suite uses Oracle Text for indexing certain queries such as item description, etc.. I was told that iStore uses it for searching on items. Is that true? Does the Oracle Apps standard Item form use it? Can it be set up for use with the apps? I know the query syntax is different (CONTAINS), and I don't see any non standard indexes on MTL_SYSTEM_ITEMS_B, so I'm not sure how I could implement the functionality in the apps. Please help!!!!

    Yes, Oracle Text is used in iStore Search Feature, Refer to code under $JAVA_TOP/oracle/apps/ibe/catalog/Search.java for an example, also look at table ibe_ct_imedia_search table and its indexes which gives an idea of how Oracle iStore is leveraging Oracle Test for Searching.
    get the data into a staging table and then create whichever index you want, dont modify the indexes on key tables like MTL_SYSTEM_ITEMS_B

Maybe you are looking for

  • Itunes will not recognize my ipod. How do i fix this?

    Itunes will not recognize my ipod. How do I fix this?

  • Generating pdf from the website

    Hi there, Match with smaller problem. I have a website where I want to put the icon to create a pdf from the site. These are website www.mapase.com. I do not use any open source as wodpress therefore I can not use plugins. I've got all code and imple

  • Bbp_mon_sc attributes

    Can someone tell me what attributes are required to run the bbp_mon_sc transaction to view carts of any requestor?  I am reaching the selection screen of the transaction and placing a single person as created by.  When I hit start I receive the follo

  • Save options to PDF

    I am using Acrobat 9 pro and standard on multiple computers running Win 7 32 bit. I can save changes to a PDF file after adding a stamp by choosing file>save or clicking on the save button. When I attempt to close the window I only get the option to

  • Is possible to change The URL of a SAP Portal ?

    I have a large URL for a SAP Portal.  http://sikpbj.grup-sig.corp:52100/irj/portal The end-user wants a short URL.    http://BI_Estrategico I don´t have experience with Portals Somebody could help me, pls, What i need to do ? Message was edited by: