Using xsql params w/in oracle text "contains" clause

Hello,
Regarding the xsql code below:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="hrefs.xsl"?>
<page connection="rxschema" xmlns:xsql="urn:oracle-xsql">
<xsql:query file="%winping-utility%" version="1.0"
null-indicator="yes" link="">
select distinct c.contentpathname
from rx_schema.ct_shared s, rx_schema.contentstatus c
where s.contentid = c.contentid
and contains (s.ul_file, '{@link} within href') > 0
and s.revisionid = (select max(revisionid)
from rx_schema.ct_shared
where contentid = s.contentid)
order by contentpathname
</xsql:query>
</page>
specifically this line:
and contains (s.ul_file, '{@link} within href') > 0
This query doesn't work, I think the "{@link}" xsql param (passed in) is being interpreted as an xml attribute (since it's within the "contains" clause), is there a way to force it to read this as a param? I also tried it w/o the braces (and I also verified that it works when I hardcode a value in place of "@link").
Thanks,
JSK

The syntax of a 'Contains' query should contain only the 'Contains' query operators.
http://www.cise.ufl.edu/help/database/oracle-docs/text.920/a96518/cqoper.htm#1360

Similar Messages

  • Oracle Text contain query limit with 9i

    The Oracle Text contain query is defined as this:
    CONTAINS(
    [schema.]column,
    text_query VARCHAR2
    [,label NUMBER])
    RETURN NUMBER;
    Is the size limit of text_query 4000 bytes with 9i? Is it increased with 10g or is it accepting CLOB in 10g?
    I always got the error: "ORA-01460: unimplemented or unreasonable conversion requested" when I do the following where p_var was dynamically passed with size of more than 4000 bytes:
    p_statement varchar2(20000);
    p_var varchar2(8000);
    p_statement := select count(*) from dewey_table where contains(concat, :x)>0;
    open m_cursor for p_statement using p_var;
    Thanks very much,
    Kevin

    The limit is definitely 4000 characters in 9i and the 10g documentation shows no change in the calling spec for that parameter.

  • Oracle text contains and mixed queries

    Trying to optimize the following sql statement using oracle text.  When postal code is given, I would like to limit the contains to only filter the smaller subset.  Both of these queries produce the same results in the same amount of time with practically identical explain plans. Is there any way to get contains to only search the subset of postal codes and not the entire table.
    select *
    from ADDRESS
    where CONTAINS(ADDRESS1_TEXT, ' "1%" AND "%str%" ') > 0
    and POSTAL_CODE like '77539%'
    select *
    from ADDRESS
    where address_id in (select address_id from address where POSTAL_CODE like '77539%')
    and CONTAINS(ADDRESS1_TEXT, ' "1%" AND "%str%" ') > 0
    Thanks for any help,
    Gus

    You can use FILTER BY in the index creation and SDATA in the query, as shown below.
    SCOTT@orcl12c> CREATE TABLE address
      2    (address1_text  VARCHAR2(15),
      3      postal_code    VARCHAR2(15))
      4  /
    Table created.
    SCOTT@orcl12c> INSERT INTO address VALUES ('12 astrb', '775391')
      2  /
    1 row created.
    SCOTT@orcl12c> INSERT INTO address
      2  SELECT SUBSTR (object_name, 1, 15),
      3          object_id
      4  FROM  all_objects
      5  /
    89979 rows created.
    SCOTT@orcl12c> CREATE INDEX test_idx
      2  ON address (address1_text)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  FILTER BY postal_code
      5  /
    Index created.
    SCOTT@orcl12c> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl12c> SELECT * FROM address
      2  WHERE  CONTAINS
      3            (address1_text,
      4            '"1%" AND "%str%" AND SDATA (postal_code LIKE ''77539%'')') > 0
      5  /
    ADDRESS1_TEXT  POSTAL_CODE
    12 astrb        775391
    1 row selected.
    Execution Plan
    Plan hash value: 3864510387
    | Id  | Operation                  | Name    | Rows  | Bytes | Cost (%CPU)| Time    |
    |  0 | SELECT STATEMENT            |          |    44 |  1320 |    13  (0)| 00:00:01 |
    |  1 |  TABLE ACCESS BY INDEX ROWID| ADDRESS  |    44 |  1320 |    13  (0)| 00:00:01 |
    |*  2 |  DOMAIN INDEX              | TEST_IDX |      |      |    4  (0)| 00:00:01 |
    Predicate Information (identified by operation id):
      2 - access("CTXSYS"."CONTAINS"("ADDRESS1_TEXT",'"1%" AND "%str%" AND SDATA
                  (postal_code LIKE ''77539%'')')>0)
    Note
      - dynamic statistics used: dynamic sampling (level=2)
    SCOTT@orcl12c>

  • Search for Special Character in  Oracle Text CONTAINS Query

    Hi,
    We have to write few query which will search for email id in the Oracle Text.
    The Search text will be like <[email protected]> .
    So email id should be searched correctly with the @ symbol.
    Similarly we want the following special character to be searched in the Text like ",',*

    You will need to escape the special characters by either using \ in front of each special character or putting {} around the whole phrase that contains the special characters, as per the online documentation:
    http://download.oracle.com/docs/cd/B28359_01/text.111/b28304/cqspcl.htm#CCREF2091

  • Oracle iRecruitment: Keyword Search within Resumes using Oracle Text

    Dear All,
    As per my understanding (and Note: 247064.1) simple Keyword searches can be performed in iRecruitment if oracle Text is installed. However searching for Keywords within resumes is not possible using Oracle Text and is possible ONLY if Resume Parsing is enabled via a third party (non-oracle) service provider.
    Can you please let me know if my understanding is correct and if not provide further inputs on this.
    Thanks,
    Subrat

    Got this confirmation from Oracle via SR:
    Resume searching is independent of resume parsing and not required to search resumes.
    Oracle Text is the text engine that allows you to search documents using content-based queries. Oracle Text allows you to upload documents, search documents, parse resumes, etc.
    Hence to conclude - Installation of Oracle Text will allow Keyword Searches on resumes.
    Thanks,
    Subrat

  • Oracle text query

    Hi,
    I have a View object with various attributes (eg, name1, name2, name3, address1, address2, address3 etc). A query/table component based on this view object works just fine. However, I wish to replace name1, name2, name3 and other attributes in the query with just 'name'. These attributes are still to be shown in the result table. This new 'name' attribute will be used in an Oracle Text query clause, instead of individual searches on each attribute.
    My plan was to simply make the various name1, name2 etc attributes non-'queryable' in the View def to hide them from the query. Then I'd add a transient 'name' attribute. My hope was, that I could override the getWhereClause() in the ViewObjectImpl and simply tack on the oracle text clause to the WHERE (example below):
    WHERE CONTAINS (
    SOMECOLUMN,
                '<query>
       <textquery lang="ENGLISH" grammar="CONTEXT">TRANSIENT_ATTR_VALUE
    ..... Oracle Text query grammar stuff here ....  </query>') > 0How do I access the transient value in the ViewObjectImpl to add the above SQL? Or am I going about this in completely the wrong way?
    thanks,
    Barry.

    Based on what I found in
    http://www.oracle.com/technology/oramag/oracle/09-nov/o69frame.html?_template=/ocom/print
    and
    http://blogs.oracle.com/smuenchadf/examples/
    136.     Introducing a Checkbox to Toggle a Custom SQL Predicate on an LOV's Search Form. [11.1.1.0.0] 19-NOV-2008
    I have the following implementation, which seems to work. Does anyone see any problems with this?
    With regard to SQL injection, does ViewCriteriaItem sanitise the 'val' from the query, or should I do that manually here myself?
        @Override
        public java.lang.String getCriteriaItemClause(ViewCriteriaItem vci) {
            if ("OraTextTransientAttrib".equals(vci.getAttributeDef().getName())) {
                if (vci.getViewCriteria().isCriteriaForQuery()) {
                    String val = (String)vci.getValue();
                    logger.debug("Doing oracle text name search on '" + val + "'");
                    // simplified version of my oracle text query
                    return "CONTAINS ('<query>..... " + val + "....</query>') > 0 ";
                } else {
                    // SQL predicate for no changes to the results
                    // spaces needed if you have several of these blocks
                    return " 1=1 ";
            // other blocks for other similar oracle text attribs
            return super.getCriteriaItemClause(vci);
        }

  • About Multi_language features of Oracle Text.

    I have a customer who has to store into one table docs in different languages and
    use contains index to perform some text search.
    He would like to use the multi_language feature of Oracle Text.
    The database we are using is Oracle 10gR2
    We create a table with doc and language column, and then we have to create the context index.
    In documentation I found some info's about how set different lexer (MULTI_LEXER) for language that have different lexer,
    different stoplist (MULTI_STOPLIST) for different languages stop words,
    but I don't understand if it
    is possible use the stemmer features for different languages, and if there are some other features that I can set for using multi_language properties.
    Thank you in advance
    Paola

    According to the online documentation: "The Oracle Text stemmer, licensed from Xerox Corporation's XSoft Division, supports the following languages with the BASIC_LEXER: English, French, Spanish, Italian, German, and Dutch. Japanese stemming is supported with the JAPANESE_LEXER."
    Please see the demonstration below. Also, if you are using 10g, you can specify the language in the query, instead of changing the language for the session. 10g also has a world_lexer.
    scott@ORA92> CREATE TABLE your_table
      2    (id         NUMBER,
      3       doc         CLOB,
      4       lang         VARCHAR2 (3),
      5       CONSTRAINT  your_table_id_pk PRIMARY KEY (id))
      6  /
    Table created.
    scott@ORA92> INSERT ALL
      2  INTO your_table VALUES (1, 'They say only the good die young.', 'eng')
      3  INTO your_table VALUES (2, 'The dogs like the cats.',          'eng')
      4  INTO your_table VALUES (3, 'cats and dogs',               'eng')
      5  INTO your_table VALUES (4, 'cat and dog',                    'eng')
      6  INTO your_table VALUES (5, 'chats et chiens',               'fre')
      7  INTO your_table VALUES (6, 'chat et chien',               'fre')
      8  INTO your_table VALUES (7, 'Die Hunde mögen die Katzen',          'ger')
      9  INTO your_table VALUES (8, 'Katzen und Hunde',               'ger')
    10  INTO your_table VALUES (9, 'Katze und Hund',               'ger')
    11  SELECT * FROM DUAL
    12  /
    9 rows created.
    scott@ORA92> BEGIN
      2    ctx_ddl.create_preference ('english_lexer','basic_lexer');
      3    ctx_ddl.set_attribute      ('english_lexer','index_themes','yes');
      4    ctx_ddl.set_attribute      ('english_lexer','theme_language','english');
      5 
      6    ctx_ddl.create_preference ('french_lexer','basic_lexer');
      7    ctx_ddl.set_attribute      ('french_lexer','index_themes','yes');
      8    ctx_ddl.set_attribute      ('french_lexer','theme_language','french');
      9 
    10    ctx_ddl.create_preference ('german_lexer','basic_lexer');
    11    ctx_ddl.set_attribute      ('german_lexer','composite','german');
    12    ctx_ddl.set_attribute      ('german_lexer','alternate_spelling','german');
    13 
    14    CTX_DDL.CREATE_PREFERENCE ('global_lexer', 'MULTI_LEXER');
    15    ctx_ddl.add_sub_lexer      ('global_lexer','english','english_lexer', 'eng');
    16    ctx_ddl.add_sub_lexer      ('global_lexer','french','french_lexer', 'fre');
    17    ctx_ddl.add_sub_lexer      ('global_lexer','german','german_lexer','ger');
    18    ctx_ddl.add_sub_lexer      ('global_lexer','default','english_lexer');
    19 
    20    CTX_DDL.CREATE_STOPLIST ('global_stoplist', 'MULTI_STOPLIST');
    21    CTX_DDL.ADD_STOPWORD    ('global_stoplist', 'and', 'english');
    22    CTX_DDL.ADD_STOPWORD    ('global_stoplist', 'und', 'german');
    23    CTX_DDL.ADD_STOPWORD    ('global_stoplist', 'et', 'french');
    24    CTX_DDL.ADD_STOPWORD    ('global_stoplist', 'the', 'ALL');
    25    CTX_DDL.ADD_STOPWORD    ('global_stoplist', 'die', 'german');
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    scott@ORA92> CREATE INDEX your_table_doc_idx
      2  ON your_table (doc)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  PARAMETERS
      5    ('LEXER           global_lexer
      6        LANGUAGE COLUMN lang
      7        STOPLIST      global_stoplist')
      8  /
    Index created.
    scott@ORA92> ALTER SESSION SET NLS_LANGUAGE = 'AMERICAN'
      2  /
    Session altered.
    scott@ORA92> SELECT * FROM your_table WHERE CONTAINS (doc, 'die') > 0
      2  /
            ID DOC                                                                              LAN
             1 They say only the good die young.                                                eng
    scott@ORA92> SELECT * FROM your_table WHERE CONTAINS (doc, 'cat AND dog') > 0
      2  /
            ID DOC                                                                              LAN
             4 cat and dog                                                                      eng
    scott@ORA92> SELECT * FROM your_table WHERE  CONTAINS (doc, '$cat AND $dog') > 0
      2  /
            ID DOC                                                                              LAN
             4 cat and dog                                                                      eng
             3 cats and dogs                                                                    eng
             2 The dogs like the cats.                                                          eng
    scott@ORA92> ALTER SESSION SET NLS_LANGUAGE = 'FRENCH'
      2  /
    Session altered.
    scott@ORA92> SELECT * FROM your_table WHERE CONTAINS (doc, 'chat AND chien') > 0
      2  /
            ID DOC                                                                              LAN
             6 chat et chien                                                                    fre
    scott@ORA92> SELECT * FROM your_table WHERE  CONTAINS (doc, '$chat AND $chien') > 0
      2  /
            ID DOC                                                                              LAN
             6 chat et chien                                                                    fre
             5 chats et chiens                                                                  fre
    scott@ORA92> ALTER SESSION SET NLS_LANGUAGE = 'GERMAN'
      2  /
    Session altered.
    scott@ORA92> SELECT * FROM your_table WHERE CONTAINS (doc, 'Die') > 0
      2  /
    no rows selected
    scott@ORA92> SELECT * FROM your_table WHERE CONTAINS (doc, 'Katze AND Hund') > 0
      2  /
            ID DOC                                                                              LAN
             9 Katze und Hund                                                                   gerMessage was edited by:
    Barbara Boehmer

  • Ultra Search/ Oracle Text capabilities

    Our decision to go forward with Oracle9i is contingent upon the extensible use of Ultra Search and Oracle Text in our planned endeavors.
    Basically we are to build a system to do the following:
    1) download information (html files, links, documents) from web sites and accessible disk archives. The url sites are particular to a domain.
    2) place the downloaded file information into our Oracle database or download to local system with appropriate links in database.
    3) perform queries on the downloaded information through the database to isolate files for analysis.
    4) analyze and perform extraction on the information. For example, query based on a defined hierarchy of vulnerability terms.
    I've demoed Ultra Search and Oracle Text. I believe that Ultra Search can handle step 1, and possibly step 2 and that Oracle Text can help in step 4. Step 3 is satisfied by the Oracle database.
    I need to know details concerning Ultra Search and Oracle Text before committing:
    o when Ultra Search performs its crawling, how is found information represented in the database. Is a whole html file or document downloaded or are references to these documents stored in the database? If references are stored does Ultra Search embed the capability to download these files to be analyzed?
    o is Oracle Text the right tool to provide the capability for robust analysis of downloaded documents.
    o I have used the sample JSP that came with Ultra Search. Are there any more detailed examples which my above steps. In particular, performing robust analysis on downloaded documents from step 1.
    We have and are still exploring other COTS products to find a solution. Are main goal is to have the retrieved documents and analysis information resident in the database in this phase of our project. We find other COTS can perform the web crawling, but lack analysis, or vice versa and that their solutions are so vendor specific that in many times their services would be required to build a suitable solution that is not very extensible.
    Thanks for any feedback.

    Ultra Search does not keep documents in the database permanently. We bring them in for indexing purposes, but remove them after
    the indexing is completed. However, we keep the URLs of each unique document that was found during the crawling. You would
    have to do the downloading yourself. However, we are thinking about providing a mechanism, maybe in the form of an API, that
    would allow customers to retrieve documents. Please contact me on this issue if you are interested to discuss this: (650)-506-8173.
    Generally speaking you will find that Oracle Text is a very powerful tool for analysis of textual documents, especially since it is
    driven through the SQL language, has extensive functionality (themes, user-defined knowledge base, thesaurus, and many useful linguistic
    functions like segmentation, stemming, and globalisation support).
    The philosophy of Ultra Search is to provide you with an out-of-the-box solution for crawling and searching your data without the
    need for programming. Ultra Search is built on top of Text, so I would advise you to use Text to do the further analysis of your
    documents after they have been located by the crawler.
    Best Regards,
    Stefan Buchta

  • Issues using Oracle Text conditions

    Hi all,
    I'm facing an issue executing a query on a VIEW using Oracle Text Indexes.
    The DB version I'm using is "Enterprise 9.2.0.5".
    TEST_VIEW is an sql-view that has a query on several tables where one of them has two Oracle Text indexes, one on field FIELD2 and another on FIELD3
    executing this query I get 10 rows:
    select *
    from TEST_VIEW
    where FIELD1 = 1001 -- regular condition
    and (contains(FIELD2, 'Blitz') > 0 ) -- Oracle text condition
    But if I add another condition on an existent Oracle Text Index, I'll get only 1 row:
    select *
    from TEST_VIEW
    where FIELD1 = 1001
    where (contains(FIELD2, 'Blitz') > 0 OR contains(FIELD3, 'Blitz') > 0)
    As you can see the third condition was added using a logical OR, so I should get at least 10 rows ...
    Can anyone help me ?
    ThaNks in advance.
    Eduardo.

    Eduardo,
    Without a full test case, it is hard to see if there is something wrong or not. I did the following, and all worked fine on my 10g instance. I had to assume some things, but I at least think I have the basic gist of your inquiry in this example. Run it/change it to match your situation, and post back when you can.
    Thanks,
    Ron
    CREATE TABLE Z_TEST1 (
    FIELD1 VARCHAR2(30));
    INSERT INTO Z_TEST1
    VALUES ('QUICK');
    INSERT INTO Z_TEST1
    VALUES ('BROWN');
    INSERT INTO Z_TEST1
    VALUES ('FOX');
    INSERT INTO Z_TEST1
    VALUES ('QUICK');
    INSERT INTO Z_TEST1
    VALUES ('BROWN');
    INSERT INTO Z_TEST1
    VALUES ('FOX');
    CREATE TABLE Z_TEST2 (
    FIELD2 VARCHAR2(30));
    INSERT INTO Z_TEST2
    VALUES ('JUMPED');
    INSERT INTO Z_TEST2
    VALUES ('OVER');
    INSERT INTO Z_TEST2
    VALUES ('LAZY');
    INSERT INTO Z_TEST2
    VALUES ('DOG');
    INSERT INTO Z_TEST2
    VALUES ('QUICK');
    INSERT INTO Z_TEST2
    VALUES ('BROWN');
    INSERT INTO Z_TEST2
    VALUES ('FOX');
    commit;
    CREATE VIEW TEST_VIEW
    AS
    SELECT Z_TEST1.FIELD1 AS "FIELD1", Z_TEST2.FIELD2 AS "FIELD2"
    FROM Z_TEST1, Z_TEST2;
    CREATE INDEX Z_TEST1_IDX ON Z_TEST1(FIELD1)
    INDEXTYPE IS CTXSYS.CONTEXT;
    CREATE INDEX Z_TEST2_IDX ON Z_TEST2(FIELD2)
    INDEXTYPE IS CTXSYS.CONTEXT;
    select *
    from TEST_VIEW
    where CONTAINS(FIELD1, 'FOX') > 0;
    14 rows
    select *
    from TEST_VIEW
    where (CONTAINS(FIELD1, 'FOX') > 0 OR CONTAINS(FIELD2, 'FOX') > 0);
    18 rows

  • Using oracle text in apex report search

    I am trying to use oracle text in apex, integrating it in an existing application. The idea is that it will allow to do a search in bigger textfields. Thats how I want it to get to work. In one of the oracle packaged applications oracle text is used as well, so I will have a look to that as well. I've addapted this search. I've added
    AND t. contains(oplossing, :P15_OPLOSSING)
    AND t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)
    That didn't work, so I changed those two to:
    AND t.oplossing = (t.contains(oplossing, :P15_OPLOSSING)>0)
    AND t.sleutelwoorden = (t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)>0)
    which didn't work either, which I expected to be the case. Clearly I'm not doing it correctly, I intend to look it up tonight in the packaged applications as I do want to findt it myself to.
    But does anyone can give a hint, on what I am doing wrong ?
    SELECT t.ticketid ticketnr, t.ticketid,
    g.voornaam||' '||g.naam aangemaaktdoor,
    t.credt, t.applicatiecd, t.titel,
    s.statusdefoms,
    si.statusdefoms instat,
    NVL2(t.toegekend,'Y','N') toegekend,
    sleutelwoorden, klantprioriteitid, oplossing, s.htmlkleur, si.htmlkleur inthtmlkleur
    FROM ticket t,
    gebruiker g,
    status s,
    status si
    WHERE t.gebruikerid = g.gebruikerid
    AND t.statusid = s.statusid
    AND t.statusinternid = si.statusid (+)
    AND t.applicatiecd = NVL(:P0_APPLICATIECD, :F101_APPLICATIECD)
    AND (t.categorieid = :P15_CATEGORIEID OR NVL(:P15_CATEGORIEID, 0) = 0)
    AND (t.moduleid = :P15_MODULEID OR NVL(:P15_MODULEID, 0) = 0)
    AND (t.statusid = :P15_STATUSID OR NVL(:P15_STATUSID, 0) = 0)
    AND (t.statusinternid = :P15_INTSTATUSID OR NVL(:P15_INTSTATUSID, 0) = 0)
    AND (t.versieid = :P15_VERSIEID OR NVL(:P15_VERSIEID, 0) = 0)
    AND t.ticketid LIKE '%'||:P15_TICKETID||'%'
    AND t.gebruikerid = DECODE(NVL(:P15_GEBRUIKERID,0), 0, t.gebruikerid, :P15_GEBRUIKERID)
    AND t.credt BETWEEN NVL(:P15_DATUMVAN, To_Date('01-01-1900', 'DD-MM-YYYY')) AND NVL(To_Date(:P15_DATUMTOT, 'DD-MM-YYYY'), sysdate) +1
    AND t.titel LIKE '%'||:P15_TITEL||'%'
    AND t. contains(oplossing, :P15_OPLOSSING)
    AND t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)
    AND PCK$Ticket_Admin.getklantid(t.gebruikerid) = DECODE(Pck$Ticket_Admin.isklantadminroleN(:APP_USER,NVL(:P0_APPLICATIECD, :F101_APPLICATIECD)), 1, PCK$Ticket_Admin.getklantid(:APP103_GEBRUIKERID), PCK$Ticket_Admin.getklantid(t.gebruikerid))
    AND (:APP103_GEBRUIKERID IN (t.voor_gebruikerid, t.gebruikerid)
    OR Pck$Ticket_Admin.isintern(:APP_USER,:P0_APPLICATIECD) = 1)
    changed to:
    AND t.oplossing = (t.contains(oplossing, :P15_OPLOSSING)>0)
    AND t.sleutelwoorden = (t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)>0)

    I have worked it further out now, and looked at the search of the packaged application. It turned out to be a pl/sql block . I used what I found in there to adapt the previous search. I added the following:
    OR (CONTAINS(t.oplossing, :P15_OPLOSSING)>0)
    OR (CONTAINS(t.sleutelwoorden, :P15_SLEUTELWOORDEN)>0)
         OR (CONTAINS(t.titel,:P15_SEARCH_T_O_S)>0 OR
         CONTAINS (t.oplossing, :P15_SEARCH_T_O_S)>0 OR
         CONTAINS(t.sleutelwoorden, :P15_SEARCH_T_O_S)>0 )
    OR (CONTAINS(t.titel,:P15_SEARCH_T_O_S)>0 AND
         CONTAINS (t.oplossing, :P15_SEARCH_T_O_S)>0 AND
         CONTAINS(t.sleutelwoorden, :P15_SEARCH_T_O_S)>0 )
    oplossing means solution
    sleutelwoorden means keywords
    titel means title
    Yet this doesn't work yet. It gives an error message:
    failed to parse SQL query:
    ORA-01719: outer join operator (+) not allowed in operand of OR or IN
    I've tried adding the addition in a different place, yet that gives the same error message. I'm not sure now.

  • Using Oracle Text to search through WORD, EXCEL and PDF documents

    Hello again,
    What I would like to know is if I have a WORD or PDF document stored in a table. Is it possible to use Oracle Text to search through the actual WORD or PDF document?
    Thanks
    Doug

    Yes you can do context sensitive searches on both PDF and Word docs. With the PDF you need to make sure they are text and not images. Some scanners will create PDFs that are nothing more than images of document.
    Below is code sample that I made some time back to demonstrate the searching capabilities of Oracle Text. Note that the example makes use of the inso_filter that is no longer shipped with Oracle begging with Patch set 10.1.0.4. See metalink note 298017.1 for the changes. See the following link for more information on developing with Oracle Text.
    http://download-west.oracle.com/docs/cd/B14117_01/text.101/b10729/toc.htm
    begin example.
    -- The following needs to be executed
    -- as sys.
    DROP DIRECTORY docs_dir;
    CREATE OR REPLACE DIRECTORY docs_dir
    AS 'C:\sql\oracle_text\documents';
    GRANT READ ON DIRECTORY docs_dir TO text;
    -- End sys ran SQL
    DROP TABLE db_docs CASCADE CONSTRAINTS PURGE;
    CREATE TABLE db_docs (
    id NUMBER,
    format VARCHAR2(10),
    location VARCHAR2(50),
    document BLOB,
    CONSTRAINT i_db_docs_p PRIMARY KEY(id)
    -- Several notes need to be made about this anonymous block.
    -- First the 'DOCS_DIR' parameter is a directory object name.
    -- This directory object name must be in upper case.
    DECLARE
    f_lob BFILE;
    b_lob BLOB;
    document_name VARCHAR2(50);
    BEGIN
    document_name := 'externaltables.doc';
    INSERT INTO db_docs
    VALUES (1, 'binary', 'C:\sql\oracle_text\documents\externaltables.doc', empty_blob())
    RETURN document INTO b_lob;
    f_lob := BFILENAME('DOCS_DIR', document_name);
    DBMS_LOB.FILEOPEN(f_lob, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.LOADFROMFILE(b_lob, f_lob, DBMS_LOB.GETLENGTH(f_lob));
    DBMS_LOB.FILECLOSE(f_lob);
    COMMIT;
    END;
    -- build the index
    -- Note that this index differs than the file system stored file
    -- in that paramter datastore is ctxsys.defautl_datastore and not
    -- ctxsys.file_datastore. FILE_DATASTORE is for documents that
    -- exist on the file system. DEFAULT_DATASTORE is for documents
    -- that are stored in the column.
    create index db_docs_ctx on db_docs(document)
    indextype is ctxsys.context
    parameters (
    'datastore ctxsys.default_datastore
    filter ctxsys.inso_filter
    format column format');
    --search for something that is known to not be in the document.
    SELECT SCORE(1), id, location
    FROM db_docs
    WHERE CONTAINS(document, 'Jenkinson', 1) > 0;
    --search for something that is known to be in the document.  
    SELECT SCORE(1), id, location
    FROM db_docs
    WHERE CONTAINS(document, 'Albright', 1) > 0;

  • Using Oracle Text with Apex

    Can someone point me to some resources on how to integrate Oracle Text and APEX to do searches, highlight results, etc (all the features of Oracle Text)?
    The data to be indexed is in files on the filesystem, so I would like to keep it that way and use the FILE_DATASTORE option for Text.
    Thanks for any pointers.
    Update: Yes, I did see http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
    but the search results there just returns the URL/file containing the "hit". It doesn't show the actual text fragment that caused the match, doesn't highlight it, etc. I am looking for a real Google-like search. Hm, having said that, I might as well use Google Desktop! Nah, where's the fun in that?

    This is a very simple application for my own use. It started life in 8i when there were fewer Text options.
    As such, it uses the query string as entered. This returns all of the matches:
    select msgid, msgdate, Box, fromaddr, subject
      from eudora.inbox
    where contains(body, :P703_MailSearch) > 0
    order by msgdate descI display the selected result like this:
    select subject,
      Replace(eudora.mmarkup(:P704_MSGID, :P702_SEARCH), Chr(13), '<BR>') Body
      from eudora.inbox
    where msgid = :P704_MSGIDIn a newer application, I experimented with the CTXCAT grammer.
    That query looks like this:
    select m.ID, m.pdpno, m.shortdesc
      from pdp_mast m
    where contains(m.dphistory, '<query><textquery lang="ENGLISH" grammar="CTXCAT">
                                             ' || :P1_Text || '
                                         </textquery>
                                      <score datatype="INTEGER"/>
                                  </query>') > 0     
        or contains(m.shortdesc, '<query><textquery lang="ENGLISH" grammar="CTXCAT">
                                             ' || :P1_Text || '
                                         </textquery>
                                      <score datatype="INTEGER"/>
                                  </query>') > 0As always, once you figure out the syntax, its easy to make it work in Apex.
    Text indexes are very fast. On my old 600MHz PC, searches in 250MB of text take less than a second.

  • Using oracle text on a non-materialized view

    I'm having trouble tracking down an error when using oracle text on a non-materialized view (indexes are on the referenced columns). My database has a users table and a user history table which saves the old values when a user profile changes. My view performs a "union all" so I can select from both at once.
    I would like to use oracle text to perform a "contains" on the view whenever someone signs up to see if any current users or historical entries contain the desired username.
    The following works fine:
    contains(user_history_view, 'bill')but when I reference anything in the contains clause, i get a "column is not indexed" error:
    contains(user_history_view, signup.user_name) --signup.username is 'bill'Here is a stripped-down demonstration (I am using version 10.2.0.4.0)
    create table signup (
      signup_id   number(19,0) not null,
      signup_name varchar2(255),
      primary key (signup_id)
    create table users (
      user_id   number(19,0) not null,
      user_name varchar2(255),
      primary key (user_id)
    create table user_history (
      history_id number(19,0) not null,
      user_id    number(19,0) not null,
      user_name  varchar2(255),
      primary key (history_id),
      foreign key (user_id) references users on delete set null
    create index user_name_index on users(user_name)
    indextype is ctxsys.context parameters ('sync (on commit)');
    create index user_hist_name_index on user_history(user_name)
    indextype is ctxsys.context parameters ('sync (on commit)');
    create index signup_name_index on signup(signup_name)
    indextype is ctxsys.context parameters ('sync (on commit)');
    create or replace force view user_history_view
    (user_id, user_name, flag_history) as
    select user_id, user_name, 'N' from users
    union all
    select user_id, user_name, 'Y' from user_history;
    --user bill changed his name to bob, and there is a pending signup for another bill
    insert into users(user_id, user_name) values (1, 'bob');
    insert into user_history(history_id, user_id, user_name) values (1, 1, 'bill');
    insert into signup(signup_id, signup_name) values(1, 'bill');
    commit;
    --works
    select * from user_history_view users, signup new_user
    where new_user.signup_id = 1
    and contains(users.user_name, 'bill')>0;
    --fails
    select * from user_history_view users, signup new_user
    where new_user.signup_id = 1
    and contains(users.user_name, new_user.signup_name)>0;I could move everything into a materialized view, but querying against real-time data like this would be ideal. Any help would be greatly appreciated.

    Hi,
    this is to my knowledge not possible. It is hard for Oracle to do, think about a table with many rows, every row with that column must be checked. So I think only a single varchar2 is possible. Maybe for you will a function work. It is possible to give a function as second parameter.
    function return_signup
    return varchar2
    is
      l_signup_name signup.signup_name%type;
    begin
      select signup_name
      into l_signup_name
      from signup
      where signup_id = 1
      and rownum = 1
      return l_signup_name;
    exception
      when no_data_found
      then
        l_signup_name := 'abracadabra'; -- hope does not exist
        return l_signup_name;
    end;Now you can use above function in the contains.
    select * from user_history_view users --, signup new_user
    --where new_user.signup_id = 1
    where contains(users.user_name, return_signup)>0;I didn't test the code! Maybe you have to adjust the function for your needs. But it is a idea how this can be done.
    Otherwise you must make the check by normaly check the columns by simple using a join:
    select * from user_history_view users, signup new_user
    where new_user.signup_id = 1
    and users.user_name = new_user.signup_name;Herald ten Dam
    htendam.wordpress.com

  • 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 &lt; 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

  • Document management system using oracle text

    i plan to create document management system using oracle text with following features
    1) document comparision
    2) document search
    and more...
    can oracle text be used to display documents of various formats by converting them to HTML. and can search keywords be highlighted in the document.
    please help!

    Have you ever considered doing this in Oracle Application Express (free on top of the Oracle database)? How about something like:
    http://download-west.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm
    Index the files using the CONTEXT index, and perhaps the docs' meta with it using the Oracle Text MULTI_COLUMN_DATASTORE, and then when you write your query for a report on the documents include a search string.
    I've created a number of APEX-based document management systems and it is quite easy once you get the hang of using this environment. I suggest looking at some of the tutorials/how-to documents and you'll be on your way quickly.
    Start with the upload application. Once you can get your documents in, create a report that shows everything except the document. Verify all of this works correctly.
    Add some "items" to the page for the report, and include them as bind variables in the where clause.
    After that, add your Oracle Text index to the database, and toss in a "text-field" item to the APEX page. Modify your report query, adding the CONTAINS clause, and use the newly created item as a bind variable. There's your keyword search.
    Linking to Oracle Apps is done through API's and may be over database links.
    Hope it helps. Though not a step-by-step how to document, this should point you in the right direction. Get familiar with APEX as that covers most of what you described.
    -Ron

Maybe you are looking for