Search with contains where text contains a query operator such as NT

I have a query that uses contains and the text I am searching for has the word 'NT' in it (ie CONTAINS(my_name, 'Windows NT') > 0). This and any other operator such as 'PT' causes the error
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: ConText error:
DRG-50901: text query parser syntax error on line 1, column 3
How do I make it search the string without parsing it? I don't know what the strings will be so the code needs to accept any string.
Thanks,
Evelyn Dobkin

There are some example query preprocessors on: http://technet.oracle.com/sample_code/products/intermedia/htdocs/query_syntax_translators/query_syntax_translators.html
null

Similar Messages

  • Search with % in oracle text

    How can i retrieve the records which has "80%" "and" keyword using oracle text . Because oracle consider " % , and , or " as the stopwords ... But i want to do the search on "80%" not "80" how to do that ....
    below query retrieving both "80" and "80%" records....but i want only "80%"
    SELECT ID, AUTHOR, DOCUMENT, PATH, PATH1
    FROM DATASTORES_TAB a
    WHERE contains ( dummy_col,'{80%}' ) > 0;

    Try this...
    exec ctx_ddl.drop_preference('my_basic_lexer')
    BEGIN
    ctx_ddl.create_preference
    preference_name => 'my_basic_lexer',
    object_name => 'basic_lexer'
    ctx_ddl.set_attribute
    preference_name => 'my_basic_lexer',
    attribute_name => 'printjoins',
    attribute_value => '_%'
    END;
    drop table t1;
    create table t1 (text varchar2(80));
    insert into t1 values ('My example is 80% complete');
    insert into t1 values ('This contains 80 without percent');
    insert into t1 values ('This contains 801 without percent');
    insert into t1 values ('Na%me1');
    insert into t1 values ('Narme1');
    CREATE INDEX t1_index ON t1 ( text )
    indextype IS ctxsys.context
    parameters ( 'lexer my_basic_lexer' );
    select text from t1 where contains (text, '80%') > 0;
    select text from t1 where contains (text, 'Na%me1') > 0;
    select text from t1 where contains (text, '{80%}') > 0;
    select text from t1 where contains (text, '{Na%me1}') > 0;
    Output:
    SQL> select text from t1 where contains (text, '80%') > 0;
    TEXT
    My example is 80% complete
    This contains 80 without percent
    This contains 801 without percent
    Elapsed: 00:00:00.01
    SQL> select text from t1 where contains (text, 'Na%me1') > 0;
    TEXT
    Na%me1
    Narme1
    Elapsed: 00:00:00.01
    SQL> select text from t1 where contains (text, '{80%}') > 0;
    TEXT
    My example is 80% complete
    Elapsed: 00:00:00.00
    SQL> select text from t1 where contains (text, '{Na%me1}') > 0;
    TEXT
    Na%me1

  • Combining Sum/Case queries with different where clauses into one query

    Hello,
    I'm trying to combine 2 queries that contain the SUM/CASE function into one query that'll produce the output in the same table, rather than having two The thing is, the two queries have different conditions. I've created a sample data table and outputs to better describe what I'm trying to achieve.
    SAMPLE_DATA
    DEPT
    PROD_CODE
    FLAG1
    FLAG2
    HO
    A
    NULL
    Y
    HO
    B
    NULL
    Y
    HO
    A
    Y
    NULL
    HO
    B
    Y
    Y
    IT
    A
    NULL
    Y
    IT
    C
    NULL
    NULL
    ENG
    B
    NULL
    Y
    ENG
    C
    NULL
    Y
    ENG
    C
    Y
    Y
    MKT
    A
    Y
    Y
    The first query I'm running is to sum the product codes department wise while checking if FLAG1 is Y. The second query is checking if FLAG2 is Y.
    First Query:
    select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end),
    sum(case PRODUCT_CODE when 'B' then 1 else 0 end),
    sum(case PRODUCT_CODE when 'C' then 1 else 0 end)
    from SAMPLE_DATA where FLAG1 is not null group by DEPT;
    Second Query:
    select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end),
    sum(case PRODUCT_CODE when 'B' then 1 else 0 end),
    sum(case PRODUCT_CODE when 'C' then 1 else 0 end)
    from SAMPLE_DATA where FLAG2 is not null group by DEPT;
    FIRST QUERY OUTPUT:
    DEPT
    PRODA_FL1
    PRODB_FL1
    PRODC_FL1
    HO
    1
    1
    0
    IT
    0
    0
    0
    ENG
    0
    0
    1
    MKT
    1
    0
    0
    SECOND QUERY OUTPUT:
    DEPT
    PRODA_FL2
    PRODB_FL2
    PRODC_FL2
    HO
    1
    2
    0
    IT
    1
    0
    0
    ENG
    0
    1
    2
    MKT
    1
    0
    0
    My aim is to combine both the queries so that the output is displayed the same way as the table below.
    DESIRED OUTPUT:
    DEPT
    PRODA_FL1
    PRODB_FL1
    PRODC_FL1
    PRODA_FL2
    PRODB_FL2
    PRODC_FL2
    Any help or tips will be greatly appreciated. Please note I'm working with more complex data and have simplified my question just to understand how to solve this.

    Just treat the two queries as tables, join them on DEPT and produce the results you want.
    with q1 as (
    select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end) PRODA_FL1,
    sum(case PRODUCT_CODE when 'B' then 1 else 0 end) PRODB_FL1,
    sum(case PRODUCT_CODE when 'C' then 1 else 0 end) PRODC_FL1
    from SAMPLE_DATA where FLAG1 is not null group by DEPT),
    q2 as (
    select DEPT, sum(case PRODUCT_CODE when 'A' then 1 else 0 end) PRODA_FL2,
    sum(case PRODUCT_CODE when 'B' then 1 else 0 end) PRODB_FL2,
    sum(case PRODUCT_CODE when 'C' then 1 else 0 end) PRODC_FL2
    from SAMPLE_DATA where FLAG2 is not null group by DEPT;
    select q1.dept, proda_fl1, prodb_fl1, prodc_fl1, proda_fl2, prodb_fl2, prodc_fl2
    from q1, q2
    where q1.dept = q2.dept

  • Search with Logical Collection

    Hi all!
    I'm on a Siebel Project and the customer has a requirement that their users need to perform a search across multiple BC's.
    Looking at the documentation on bookshelf (Siebel Search Administration Guide), i found that is possible group search categories into logical collections and then it's possible to search on multiple BC's.
    Does anyone know if with the logical collection procedure can I fill different fields of differente categories or can I just fill a generic search field that search the term in all the categories I definied to the logical collection?
    If anyone have experiences on Siebel Search and logical collection to share, i would appreciate!
    Thanks in advance
    Rafael Feldberg

    You have to distinguish between attribute search and full text search:
    In attribute search you can use logical operators by using the generic Select Options just like in any other search help.
    In full text search all entered search words are interpreted with AND conditions.
    If you just press the generic F1 for help on the field "Full Text Search" you will receive the complete standard documentation.
    OR conditions in full text search are not supported because of the restrictions of the generic F4 UI.
    If you want to support OR conditions you should consider installing the SAP product NetWeaver Enterprise Search. The full text search in it's generic search UI contains a query parser that supports the following (and more) features:
    [http://help.sap.com/saphelp_nwes72/helpdata/en/d0/297dfa25a24a57a31e8364ee2ad7eb/frameset.htm]
    Instead of contructing OR conditions it's sometimes much more convenient to browse with NetWeaver Enterprise Search through the distinct value lists of attributes: Read "Narrowing Down Results" in:
    [http://help.sap.com/saphelp_nwes72/helpdata/en/df/f2fb01b6844246b121497b633d83a5/frameset.htm]
    Enjoy! - Klaus

  • Query Operator "IS" is not working good for object type "String"

    Hi,
    I have a problem with advanced search. When the object type is String, and I want to search directly value (for exemple 'a') i have returned all value starts with 'a', even though I set Query Operator to "IS"
    When I use Query operator "setByUser", and then set property to "IS", query behaviour is correct.
    Behaviour example for operator "IS":
    values: a, ab, abc
    searching: 'a' --> expected results: a results: a, ab, abc
    Any sugestions??
    Sorry for my English
    Regards,
    Wojciech Mularczyk

    Syed,
    Only under advanced search. The operator used for quick search is defined through two properties in JhsAdvancedSearch bean class:
    private String defaultStringOperator = "startsWith";
    private String defaultNonStringOperator = "is";
    So, if you have a String attribute which holds numbers and you want to apply the "is" operator to this attribute, you can change the default value of "defaultStringOperator" by creating a custom template for searchBean.vm, and add the following property:
    <managed-property>
    <property-name>defaultStringOperator </property-name>
    <value>is</value>
    </managed-property>
    Note hat you can already apply this technique in the current release.
    Steven Davelaar,
    JHeadstart Team.

  • RequestTimeoutException during a InvocationService#query operation

    Hi,
    I would like to know how Coherence will handle the case where during an InvocationService#query operation that executes the operation in several cluster nodes and while many of the nodes finished the operation before the request times out others fail due to the timeout. In other words, will I get a Map with the result of those nodes that finished the operation or will I get a RequestTimeoutException and no results?
    Thanks,
    -- Gato

    Hi Gato,
    If you look carefully at the RequestTimeoutException Javadoc, you will notice a method getPartialResult(), which serves exactly the purpose you asked about. It allows you to have your cookie and eat it too - you will know that some node(s) timed out, but will be able to see results by nodes that executed timely.
    Regards,
    Gene

  • How to customize quick query to search with SQL in contain keyword

    I want to build simple query using quick query component. But it will search with SQL equal keyword. How can I customize it to use contain keyword instead. That means, I enter 'sc' to return 'scott'.

    Not sure if the technique described here http://tompeez.wordpress.com/2011/08/21/extending-viewcriteria-to-use-sql-contains-4/ can be used for quick query, but you can try ...
    Timo

  • Oracle text - issue with contains query

    Hello,
    Need urgent help.
    Following code in my procedure is giving me error.
    TYPE c_1 is ref cursor;
    result_cursor c1;
    i_text2 := 'NEW%';
    open result_cursor for
    'select /*+ INDEX_SS_DESC(e cad_addr_idx2 )*/
    from cad_address
    where
    contains(text, {:i_text2}, 1) > 0
    and rec_type in (1,2,3,4)
    order by occur_count desc'
    using
    i_text2;
    ORA-00936: missing expression
    ORA-06512: at "AV_OWNER.MY_PROC", line 43
    ORA-06512: at line 6
    Oracle version is 11.2.0.3.0.
    Thanks,

    check your table is 'text indexed' on this 'Text' column.To knoow more about 'text index' go to
    http://docs.oracle.com/cd/B19306_01/text.102/b14217/ind.htm
    Also refer to the below thread where someone had faced issues with CONTAINS clause.
    ORA-20000: Oracle Text error: DRG-10599: column is not indexed

  • Query with contains is slower than like

    Hi,
    I have a column index with interMedia ConText. However, I run the same query except the where clause like as below:
    Both query select same column and from same table.
    Query 1.
    ......where contains (text, 'pass')>0
    Query 2.
    ......where upper(text) like '%PASS%'
    Both query returns 476 row of records,
    but query 1 return result after 32 secs
    and query 2 return result in only 3 secs.
    Why? Isn't ConText supppose to be faster?
    if not should not be slower so much than the normal like statement?
    Please explain and advice if there is possiblity that some thing is wrong.
    Thanks.

    you don't state the version number; I'm assuming it's at least 8.1.5, since you call it interMedia. How long are your documents?
    Do your queries really need to do double-wildcarding ("grep")? iMT indexes are "inverted lists" which do a direct look-up of the word you are searching for. In this case, it needs to do a full-table-scan of the $I table to find all matches.
    There is a "double-truncation" feature in 8.1.6 that will get rid of the performance problem, but this was built for pharmaceutical searches, where the words get very long and are composed of many compounds. It is usually not useful for general text retrieval.
    What are your users querying on, what information needs do they have?
    Paul
    null

  • Button with pre element text is given a container div

    Hi!
    Just installed 4.2.2.00.09 and imported a workspace and an application. Worked fine.
    I noted a page display difference when compared to the exported application (4.1.0.00.32). I have (so far) found this:
    If I have a button with Pre Element Text set to <div class="dummy"> and Post Element Text set to </div>, Apex generates an extra div around it all.
    If my button was named P1_SUBMIT I end up with
    <div id="P1_SUBMIT_CONTAINER">
    <div class="dummy"> <input type="button" value="Search" id="P1_SUBMIT" /></div>
    </div>
    Is it possible for me to turn this extra div off?
    Kind regards
    Tomas

    Hi,
    Change the "Number of Columns" setting in the "List of Values" where you define the 1,2,3,4,5 to "5", and you'll be all set.
    --Jennifer                                                                                                                                                                                                                                                                                                   

  • Problem with Contains - missing records

    Hi, 
    I have created a full-text catalog for my table tDoc, but when I search records with contains, 
    I dont get all records. I search for 16949, and with LIKE, I get all 5, but with CONTAINS I only 
    get three. Se image below.
    What I am doing wrong?
    It does not make any difference if I use wildcards (*) with contains.
    /Daniel.

    Hi Samus
    I hope you are still here, If so, then please close the thread by marking the answer that fit your needs or please inform us if the issue is still open. In the mean time I will try to give some
    points that you need to consider
    >> Full-text queries perform linguistic searches against text on
    words and
    phrases based on rules of a particular language.
    * It is look like you use FTS as a "like" filter, and this is not the same! It's like using subtraction in math, in order to obtain the + behavior. It can be done [10-(-10)], but should it done? are you using the right operator if you want
    to get "like" filter? In contrast to full-text search, the LIKE Transact-SQL predicate works on character patterns only.
    * Jayakumaur gave you the great basic explanationIn the forum we can not always to write the exact full tutorial. It is more of a short solutions place, where we can point you to external links if needed.
    * It is not that "/" is a noise exactly (actually this statement was wrong). It is more of "Separator" between words. SQL Server FTS engine recognize that this is not part of the word. Same with "," or spaces for example, but
    not "_" which in most languages used as part of the word. The engine work on linguistic searches, like it "understand" the language (using the dictionary it has), and therefore it recognize starting/ending of "words". It is working
    on word but phrases as well.
    FTS separates the string into individual words based on word boundaries (Separators).
    You can see the words split result using this statement:
    SELECT * FROM sys.dm_fts_parser (' "Standard ISO_TS_16949_2009" ', 1033, 0, 0)
    GO
    Now you can see that those words do not fit your search :-)
    * Moreover you can chake this "Standard ISO_TS_16949_2009 is", and see what a noise word mean (the "is" is a Noise word and not the "/")
    * Now you can try "Certifikat ISO TS/16949" and you will see that "/" is not a word at all but only a "Separator".
    >> FTS will not match the exact word, but the
    meaning of the words in the search condition.
    >>See more:
    http://msdn.microsoft.com/en-us/library/ms142571.aspx#like
    * Configure and Manage Word Breakers and Stemmers for FTS (by default "_" is not a Breakers but you can add it if you want!)
    http://technet.microsoft.com/en-us/library/ms142509%28v=sql.110%29.aspx
    * sys.dm_fts_parser (Transact-SQL)
    http://technet.microsoft.com/en-us/library/cc280463%28v=sql.110%29.aspx
    [Personal Site] [Blog] [Facebook]

  • Problem with CONTAINS function

    Hi all!!
    i got a problem with contains function. i'm running oracle 11g.
    if i execute this query:
    SELECT x.lid as id,  x.sztitular as titular, e.szname as proName, x.szresumen  as resumen, b.sztitle  as catName,
    f.szname  as secName, d.szname  as cliName, x.datecreation as datecreation
    FROM CPR_PRACTICAL_CASE x,ctg_category b, CPR_CLIENT d, pro_product e, CAT_SECTOR f, CPR_PCASE_PRODUCT g, CPR_PCASE_SECTOR h,
    PRO_PRODUCTCATEGORY i WHERE  x.lid = g.lpcaseid and e.lid = g.lproductid and x.lid = h.lpcaseid
    and f.lid = h.lsectorid and x.lclientid = d.lid and i.lproductid = e.lid and  b.lid = i.lcategoryid
    AND x.szlocale = 'es-ES' AND  x.bavailable = '1'i get 1 row as result with the column sztitular = "rodillos de medidas"
    if i only add one more sentece to that query:
    AND CONTAINS( x.sztitular, 'rodillos',1) >0the query returns an empty set.. i really don't understand why because the term "rodillos" is present in the row's column called "sztitular"...
    i've put an index on that column:
    create index ITXT_TITULAR on CPR_PRACTICAL_CASE(sztitular) INDEXTYPE IS CTXSYS.CONTEXT;any help?
    many thanks!!!!
    Edited by: ElMazzaX on May 21, 2012 5:51 PM
    Edited by: ElMazzaX on May 21, 2012 5:53 PM

    How are you synchronising the index?
    http://docs.oracle.com/cd/E11882_01/text.112/e24435/ind.htm#i1008452
    Also see the Oracle Text forum:
    Text

  • Search 'filename contains' in finder. Help please

    Hello. I need to search my filesystem for any files containing the words "foo" (for example). Currently, when I type 'foo' into my finder search bar, it returns only those filenames starting with the word 'foo'. Can anyone tell me the way to adjust search behavior to search filenames containing 'foo' instead of starting with 'foo'?
    Thanks!

    That's odd: if I open the Applications folder, then do a Command-F search, with the criterion of
    "Name contains and"
    on the Apps folder, I get 143 results, including things like
    GarageBand
    GrandPerspective
    HandBrake
    Random Spheres.bmp
    copyLibFile.command
    bread and wine
    CopyAndPaste.js
    And so on. If I add the restriction, "Kind is Applications" I get four results:
    GrandPerspective
    PandoCalendar
    HandBrake
    GarageBand
    HOWEVER, if I leave the restriction "Kind is Applications" and delete the "Name Contains" criterion, and instead put and in the Search for field I get this bewildering result:
    CSSEdit
    Xee
    Neither seems to have anything to do with my Search for term. Looking at the metadata which is indexed I see both do have the actual word "and" at some point in their metadata. Poking around a bit and thinking, I concluded that the only way to get a partial name search is to use the "Name contains" criterion. If you use the Search box with the only criterion being "Kind is Any" you will get:
    1. Any file that has the word "and" in its content
    2. Any file whose metadata contains the word "and"
    3. A file where "and" is separated in the title by any method that Spotlight recognizes as a delimiter; thus you will get "Roll and Crash" and "Pen And Ink" and "FiveBySevenAndThreeH.txt" but not something like GarageBand.
    The delimiters that I know about off-hand are capital letters, spaces, the underscore (thus something like "washanddry" would show up), and periods (so if a file was named "foo.and.txt" it would show up). There are probably others as well.
    Francine
    Francine
    Schwieder

  • Publishing server doesn't work - error 'The request URL doesn't contain the query string for the client OS'

    Hi,
    I'm trying to setup an App-V environment in my lab.
    I've used the App-V 5.0 Trial guide to help me configure all necessary components.
    I'm able to install everything without error.
    when come time to publish an app, it simply doesn't show up on my client.
    after looking at events on the client and server, I found that the Publishing server is returning under Admin the following message.
    'The request URL doesn't contain the query string for the client OS'
    My setup is pretty simple.
    App-V Server managament and Publishing on the same box
    App-V database on my SQL server.
    I'm able to see the publishing "webpage" by using http:://localhost:889.
    It only display this :
    -<Publishing Protocol="1.0"
    <Packages />
    </Publishing>
    I've published one app from the management console.
    any idea what could mean this error?
    thanks

    Hi,
    thanks for the link.
    I've validated the suggested debug steps. It seems that the problem is with my Publish server again.
    I've looked in the web.config file. It seems to be missing some parts compare to the example provided.
    Again, I've published an application from the management console. Management and Publishing are running on the same box, while SQL is remote.
    Here's the web.config
    <?xml version="1.0" ?>
    - <configuration>
    - <system.web>
    <compilation debug="false" targetFramework="4.0" />
    <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" />
    - <authentication>
    - <!-- We don't support form authentication, but this will supress x-ray security warning
    -->
    <forms requireSSL="true" />
    </authentication>
    </system.web>
    - <system.webServer>
    - <modules runAllManagedModulesForAllRequests="true">
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
    - <security>
    - <requestFiltering>
    - <verbs>
    <remove verb="GET" />
    <add verb="GET" allowed="true" />
    </verbs>
    </requestFiltering>
    </security>
    </system.webServer>
    - <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    + <behaviors>
    - <serviceBehaviors>
    - <behavior name="">
    <serviceAuthorization impersonateCallerForAllOperations="true" />
    <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    - <bindings>
    - <webHttpBinding>
    - <binding name="SecureBinding">
    - <security mode="Transport">
    <transport clientCredentialType="Windows" />
    </security>
    </binding>
    <binding name="UnsecureBinding" />
    </webHttpBinding>
    </bindings>
    - <protocolMapping>
    <add scheme="http" binding="webHttpBinding" bindingConfiguration="UnsecureBinding" />
    <add scheme="https" binding="webHttpBinding" bindingConfiguration="SecureBinding" />
    </protocolMapping>
    - <standardEndpoints>
    - <webHttpEndpoint>
    - <!--
    Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
    via the attributes on the <standardEndpoint> element below
    -->
    <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
    </webHttpEndpoint>
    </standardEndpoints>
    </system.serviceModel>
    </configuration>

  • There are no functions containing returntype = 'query' and access!

    Hi there
    I am trying to add a recordset after defining a datasource and I keep getting the error when I do a CFC query search
    there are no functions containing returntype = 'query' and access!. I have attached an image to show the error messag I get.
    Can someone help me fix this? my datasource shows up as correctly configured in cold fusion and the mysql database is well configured as well.

    okay, adding another function to the CFC and saving it makes
    it suddenly, magically visible to the function invocation window?
    I don't understand.

Maybe you are looking for