Generic String Search

Hi Friends ,
I want a generic function via which i can search the data just like google-search, for example the
following query will return a set of records, the query is written as follows:
with t as
select 'internal production order' a from dual
union all
select 'internal sale order' a from dual
union all
select 'sale order' a from dual
union all
select 'production order' a from dual
union all
select 'internal jobwork' a from dual
union all
select 'internal order' a from dual
select * from t
case 1 :- i/p search string->'internal order' or 'order internal'
then
o/p like --
internal production order
internal order
internal sale order
don't come sale order,production order,internal jobwork
case 2 :- i/p search string->'internal order' or 'order internal'
then
o/p like --
internal production order
internal order
internal sale order
I have given you the two cases as is written above, in simple language  all i want is to search
like google, suppose i type in any order ( for example i type "ankit", then 
it should return those records from consisting of "ankit"  BUT suppose i want to search "ankit
bhatt", then the query should be like that even if i type "bhatt ankit", it should return those
records which consists of "ankit" and "bhatt" IN ANY ORDER.
please run the above query and provide me that query in which i should be capable of searching the
records ( irrespective of the order of input i make in ).
Thanks

It looks like I already gave you the answer in a prior thread.
Generic search for string
MK

Similar Messages

  • Problem in String Search using OKAPI in 9i Lite

    We are creating an Symbian EPOC application using Oracle 9iLite in stand-alone mode. We have managed to create a C++ program that creates an Oracle database on the Nokia Communicator 9210.
    The problem is that a string search returns either null or all of the searched records, ie. it does not work.
    The code below should do the string search and return the strings that match the given keyword. Any idea why this is not working? We are using OKAPI.
    TempCond[0].Operator = OK_GT;
    TempCond[0].AttrPos = KEYWORDREFERENCE_INDEX_FOR_KEYWORD;
    TempCond[0].AttrVal.BufPtr = (unsigned char*) szGivenKeyword;
    TempCond[0].AttrVal.BufSize = OK_NEW_ARRAY | strlen szGivenKeyword);
    TempCond[0].AttrVal.Indicator=1;
    TempCond[0].Collate=0;
    TempCond[0].Connective=OK_AND;
    // Iterate through the entire group, extracting the key data
    //(whatever the key may be) and the object reference, and
    // append to the end of the array.
    e = okCreateIterator( iEnv,
    iEbmgKeywordReferenceGroupRef,
    iEbmgKeywordReferenceClassRef,
    FALSE,
    1,
    TempCond,
    20,
    0,
    NULL,
    &iter
    Thanks for any help you may provide.

    I am sorry, this is not an answer to your question but a little help from you is well appeciated.
    I have just started exploring oracle 9i Lite to develop apps. on Palm and WinCE using OKAPI but the documentation does not seem enough. Is there some book or sample programs available that demonstrate OKAPI to develop form based apps ? CodeWarrior and Satellite Forms are not good when someone wants to try writing demp app.
    Thanks,
    Ashish

  • Filter for Generic document Search

    Hi experts ,
    i need a filter in the generic document search of by B2B internet sales shop. The user should be only allowed to find documents starting with "xy" in the reference numbers. I know that I simply have to edit the generic-searchbackend.xml, but how?
    Thanks in advance
    Mirko

    Hi,
    please check the Development and Extension Guide, page 101 and following. This explains how the xml document is built up in more detail.
    [http://service.sap.com/~sapidb/011000358700000469462006E/SAP_ISA50_DevAndExtGuide.pdf]
    Thanks
         Dominik

  • String search

    i hI have a string "1234, abcdef, bbbbb"
    How do one get/search for the "abcdef" or "bbbb" out of the string using substring?
    If anyone has source code or references (for similar code) searching for "abcdef�(normally text enter in a text field that will be used to search through a string) It would be appreciated

    // This might help!
    String search = "test";
    Pattern pattern = Pattern.compile(".*" +search +".*");
    boolean test = pattern.matcher(testString).matches();

  • Multiple Filters in a Generic ldap Search.

    Hi all,
    'am involved in developing a generic ldap search utility. I would like to know if there is a provision to give multiple filters while searching the LDAP.
    The scenario is like this,
    like if i give the search criteria as java ldapSearch "empid=111*" I will get a series of results.
    WHAT I WANT:
    Will i be able to specify something like empid=11* and lastname=xxx*.
    Any pointers on this would be of tremendous help.
    Anticipating a reply.
    Regards,
    Sathya Sayee.S

    You can use | as 'or condition'. For example the condition
    sn=foo and (email=[email protected] or email=[email protected])
    (&(sn=foo) (|(email=[email protected]) (email=[email protected]))
    the operator are :
    AND : &
    OR : |
    NOT : !
    the notation works as HP calculator notation
    Simon Pierre NOLIN

  • Help me in writing ajax string search from database

    {noformat}*hi everybody,
    please send me a ajax with jsp application
    suppose i enter a word in text area ajax will populate/suggest all string from database ,who started
    from that entering character(s).like a google string search.
    please send full source code
    *{noformat}

    shadab_think_globally wrote:
    {noformat}*hi everybody,
    please send me a ajax with jsp application
    suppose i enter a word in text area ajax will populate/suggest all string from database ,who started
    from that entering character(s).like a google string search.
    please send full source code
    *{noformat}how about you do it yourself?

  • Faster string search options

    Hi
    I am an intern at a mobile technology firm assigned the job of enhancing the search performance of a tool, which is coded completely in java. This tool, along with other features basically searches for the substring in a string array by using the string.indexof() method which is very slow, since i am dealing with vast amount of data..
    Now the last two weeks all I did was try and understand the massive code. These are the alternatives I came up with. I could do with suggestions about the feasibilities of these ideas.. or any new suggestions are welcome..
    1. are there any faster ways instead of string.indexof() that i can use to do my string search?
    2. How about replacing this indexof() method with a faster search algorithm? something like boyer-moore for example??
    3. will using a the .nio package instead of .io package work???
    4. how about completely scrapping this string search and taking in the data from input stream as integer format.. and then doing the comparisons??
    thanks
    mahima

    yumjay wrote:
    1. are there any faster ways instead of string.indexof() that i can use to do my string search?You seem to have found one in section 2.
    2. How about replacing this indexof() method with a faster search algorithm? something like boyer-moore for example?? Well obviously you can't override or replace String's indexOf, but you could certainly change the code to use a different algorithm. What's stopping you?
    3. will using a the .nio package instead of .io package work??? Not sure, there may be virtue in some of the memory mapping additions, but I don't really know your requirements or situation.
    4. how about completely scrapping this string search and taking in the data from input stream as integer format.. and then doing the comparisons?? The string search is essentially doing integer comparisons on data 16 bits at a time (that's the width of a char). So first, remember that the int returned by InputStream.read() isn't really an int but a byte stuffed into an int (so they can return -1 on EOS). That said, you might experience a performance gain if you put the data into ints or longs (depending on your computer architecture) and then use something like boyer-moore, because your computer can likely do comparisons of two bytes, chars, shorts, ints (and perhaps even longs on a 64-bit architecture) in the exact same amount of time. They're probably even the same machine instruction. You also wouldn't therefore have to decode the input data into a string either. But you'd have to encode your search string into integers. So yeah you could potentially squeeze a bit more speed, not likely more than 50% though.

  • Exact string search

    i was wondering if there was a way to do an exact string search in a document.
    If i have a document that has punctuation i want to be able to find the document only if i query whith an exact string match, including stopwords and punctuations.
    if the query is
    select *
    from documents1
    where contains(OBJECT_VALUE,'{hello, world}') > 0
    I want only to return the documents that have exactly "hello, world" whith the comma included.
    If i add the comma to printjoins, it would work, But when i query for only "hello" it wont match "hello, world"
    basicaly im looking for something that does a normal search but then check if the exact string is in the match area.

    Try this
    select substr(&P, (INSTR(&P, CHR('32'), 1))+1, (INSTR(&P, CHR('32'), 1)))
    from dual
    &p is a variable
    I am sure this will help you in any of case
    chr(32) will return space, If you have any other thing except space then you just replace 32 with that ascii code. Such as for
    1(we)2 then query will be
    select substr(&P, (INSTR(&P, CHR('40'), 1))+1, (INSTR(&P, CHR('41'), 1)))
    from dual
    Try it and tell is it working fine

  • Like %, string search

    Hi all,
    I am making a application in which there is string search but i dont know how to find a solution.
    For example in sql, there is (like %) expression to find similar words. But in java how can I do that.
    For instance word1 = mehmet, word2 = mehemet.
    How can i do it?
    Thanks...

    regerybets wrote:
    Hi all,
    I am making a application in which there is string search but i dont know how to find a solution.
    For example in sql, there is (like %) expression to find similar words. But in java how can I do that.
    For instance word1 = mehmet, word2 = mehemet.
    How can i do it?
    Thanks...Sounds like a job for Levenshtein. Apache has an implementation in their Commons-Lang API:
    import org.apache.commons.lang.StringUtils;
    public class LevenshteinDemo {
        public static final int MINIMUM_LIKE_DISTANCE = 4;
        public static boolean like(String wordA, String wordB) {
            return like(wordA, wordB, MINIMUM_LIKE_DISTANCE);
        public static boolean like(String wordA, String wordB, int permittedDistance) {
            return StringUtils.getLevenshteinDistance(wordA, wordB) <= permittedDistance;
        public static void main(String[] args) {
            String a = "mehmet";
            String b = "mehemet";
            String c = "ambulance";
            String d = "meehemeet";
            String e = "mhmt";
            System.out.println(like(a, b));
            System.out.println(like(a, c));
            System.out.println(like(a, d));
            System.out.println(like(a, e));
    /* output:
                    true
                    false
                    true
                    true
    */Download it here: [http://commons.apache.org/downloads/download_lang.cgi], stick the file commons-lang-2.4.jar in your classpath and the snippet above will compile. Of course, you may want to make permittedDistance variable depending on the size of the input words. Now it will only work for small strings/words, not larger chunks of text.

  • Approximate string search

    Hi everyone,
    If anyone here is interested in approximate string search algorithms, take a look at this prototype: http://scientechs.com/servlet/smartsearch.test.ApproxiMatchServlet . Keyword DB was compiled from the list of canadian business names and has right now ~200K of words, so don't expect to find every english word there.
    Source code would be uploaded to sourceforge soon (smartsearch.sourceforge.net). If anyone wants to participate in improving the project, drop a note. All feedback is welcome.

    From the description:
    "Approximate string search algorithm implementation (the algorithm was developed from the scratch, so it is NOT an implementation of existing algorithms), written in Java and runs under any OS that supports Java2 platform."
    I know there are a number of approximate string matching out there. My question is how does your algorithm relate to the other ones?
    I tried keyword apple, so it seems there is more work to do, but at least it worked.

  • Is there any API available to do string search and replace?

    as above?

    For simple string searching have a look at java.util.StringTokenizer.
    Regular Expressions are included in v1.4.
    Have there a look at the String class itself and the new java.util.regex package.
    Greets
    Puce

  • [svn:osmf:] 11361: Adding a generic binary search utility ( updating project file).

    Revision: 11361
    Author:   [email protected]
    Date:     2009-11-02 05:21:35 -0800 (Mon, 02 Nov 2009)
    Log Message:
    Adding a generic binary search utility (updating project file).
    Modified Paths:
        osmf/trunk/framework/MediaFramework/.flexLibProperties

    Hi,
    try this forum: WebCenter Portal
    Frank

  • [svn:osmf:] 11360: Adding a generic binary search utility.

    Revision: 11360
    Author:   [email protected]
    Date:     2009-11-02 05:20:56 -0800 (Mon, 02 Nov 2009)
    Log Message:
    Adding a generic binary search utility.
    Modified Paths:
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/MediaFrameworkTests.as
    Added Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/utils/BinarySearch.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/utils/TestBinarySearch.as

    Indeed. Thank you for pointing this out and for all your other help.
    Edited version of Step 2:
    You can now continue to add the printer, for this you need to know the IP address:
    Open System Preferences
    OpenPrint & Fax
    Click the + button
    Select IP
    ADDRESS - Enter the IP address of the iRC2880
    PROTOCOL - Change the menu to HP Jetdirect
    QUEUE - Leave print queue blank
    NAME- Shows the IP address by default, change if desired
    LOCATION - Empty by default, fill out if desired
    USE - select Generic PCL (or if the imageRUNNER has the optional Postscript kit installed, you can select Generic Postscript), this is the built-in generic driver
    Click Add
    The printer should now be installed, try printing

  • Javamail - using a generic string in addFrom or setFrom

    Hi
    I would like to send out e-mail that the from address would be a generic string such as "Please contact customer service at 333-3333"
    instead of a valid email format such as [email protected] Is it possible.

    Varying In List

  • String search in SAP Script and Smartforms

    Hi All,
    We have an urgent requirement where we need to search for a character string in all SAP Scripts and Smartforms in our system.
    It would also help if we can get the names of programs/function modules which are internally generated for the same.
    Any pointers on the same would be helpful.
    Regards,
    Saurabh

    You can create a variable window in the main window.
    You can restrict the last item of the main window by varying the size of main window. In your wite-form ,
    CALL FUNCTION 'WRITE_FORM'
          EXPORTING
             element                  = 'ITEM'
          function                 = 'SET'
          type                     = 'BODY'
          window                   = 'MAIN'
          EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            spool_error              = 8
            codepage                 = 9
            OTHERS                   = 10.
        IF sy-subrc <> 0.
    DO this. in the bottom of the main window, create a variable window.
    you can add your text in the variable window inside main window.
    it will be displayed just after the item ends.
    Reagrds,
    Pritha.
    Message was edited by:
            Pritha Agrawal

Maybe you are looking for

  • N85 keypad backlight problem

    I find an annoying problem with the backlight, if I power on the phone in complete darkness there is no backlight on the keypad, so I couldn't key in my PIN correctly and will lockup the SIM !!

  • Multishift factor

    Hello All, How should I put Variable dep.portion if multishift factor is different for each of depreciation area? Thanks!

  • How to upload the data from existing ods to new cube?

    Hi all, There is an existing ods and reports are been created for that ods. My task is to create a cube and pull out the data from the ods to cube. I have created a cube with update rule. And i want to know to how to load all the data from the existi

  • Script print o/p

    Hi Expert,               The print o/p is comming like this format: aa              bcd          uio       123 aa              bcd          uio       569 bb              rew          iop        cc              tre           poy      428 dd           

  • Syscopy (during Unicode convertion): Import on same tablespace layout

    Hi forum, we're working on a Unicode convertion of our ECC landscape made of Solaris 10 Sparc and Oracle 10.2.0.4. We use the procedure described in UC for SAPNetWeaver 7.0 SP 14 and higher. Export runs well without error or problem in our db (1,6 TB