How to search for subset of string

Hi,
I'm trying to implement Oracle text in 8i and 9i to search for a given string or a subset of string.
For example, if the given string="Database Technology", I would like intermedia to first search for the exact string - "Database Technology",
if not found, then search for either "Database" or "Technology".
I'm only able to search for the exact string ("Database Technology") so far by using the contain clause. I'm not able to get Oracle Text to return me any records that also contains "Database" or "Technology" if the exact match "Database Technology" cannot be located.
Any help is very much appreciated.
thanks.
elain

You need to use the ACCUM operator. It raises the score based on the the frequencies of more than one word. Here are the contents of my TEXT1 test table:
TEXT
database
server
database server
database blah blah database
database blah blah server
select score(1), text1.* from text1 where contains(text,'database ACCUM server ACCUM database server',1) > 0 order by score(1) desc;
and here are the results:
SCORE(1) TEXT
68 database server
34 database blah blah server
2 database blah blah database
1 server
1 database
You may want to put a multiplier on the "database server" phrase's score to increase the score on when the complete phrase is found. That looks like this, for example:
select score(1), text1.text from text1 where contains(text,'database ACCUM server ACCUM database server*3',1) > 0 order by score(1) desc
Tom Best

Similar Messages

  • How to search for a pattern string in entire registry and delete all the keys and subkeys that contain the pattern (C# or VB)?

    I want to search for a pattern string in the entire registry and need to delete all the keys and sub-keys that contain the pattern. How can I implement this in VB Script or C#? Appreciate if you can give some sample examples. Now every time, I am manually
    searching for the pattern in registry and deleting one by one.
    Thanks Prasad

    There is no built in way to do this. You'll end up having to enumerate all keys and values in the entire registry and comparing each one for a pattern using Regex or similar.  This is going to be really slow but there isn't much else you can do about
    it (other than parallelize the enumeration).  Also note that you won't have permissions to all keys for read and/or write access so you'll need to skip over those using exception handling.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • How to search for a text string in Reports designer?

    In iDS reports (10gR2), I want to search from top down for a text string was used in one of the queries or triggers. In Forms, you can do it, in reports the related menu item is always seems to be grayed out no matter what item I pick in the Navigator. Is it doable or not? If yes, then how. I don't wanna open each program piece including the queries in the data model, report triggers or program units and look for (by visual scanning) for the text I am searching for. This is crazy. There must be a way to do it. Thanx.

    That is pretty bad for such an expensive report development program. The forms allows it, I wonder why Oracle did not include similar functionality in the reports developer. I knew the conversion to ascii, but during development it is pain in the ... just to search for a simple text string in the related program units in the report, to convert to ascii, do the search and then go back to the developer. Anyway, if that is the only way, there is nothing we can do I guess :(

  • How to search for a specific String within an ArrayList

    I am creating an inherited class, CD, that has a field of "tracks". I am wondering how you would search through the ArrayList and list the track number that correlates with a search term. For instance, if I have a track called "Radar Love" and it is track number 2, how would I create the search function to find out what track number "Radar Love" is?

    trojansc82 wrote:
    int index = 0;
    boolean found = false;
    while(index < tracks.size() && !found){
    String track = tracks.get(index);
    if(track.contains(searchString)){
    found =true;
    else{
    index++;
    return index;It's still the same code. I attempted putting in a return statement with tracks.get(index), but it didn't work.Edited by: Edward_Kimber on Nov 15, 2008 2:57 PM

  • How to search for a matching string

    <cfcatch>
    <CFMAIL to="[email protected]" From="[email protected]"
    Subject="Error message" Type="HTML">
    #cfcatch.message#
    </CFMAIL>
    </cfcatch>
    I need to create a condition based on the string in the
    message, if #cfcatch.message# is "The element at position 12 of
    dimension 3 can not be found" I need to deliver certain message
    through email BUT if #cfcatch.message# is matching other
    sentence I need to deliver a different message.
    I used the following condition (see below) but it somehow did
    not work, even when I know for sure the error message is saying the
    right think, for example, "The element at position 12...etc"
    Is there a way to do this differently or have I done it wrong
    somewhere?
    <cfif #cfcatch.message# EQ "The element at position 12 of
    dimension 3 can not be found">
    Deliver message 1
    cfelse>
    Deliver message 2
    </cfif>

    Why not catch a specific error type?
    <cftry>
    <cfthrow type="foo.bar.custom" message="anything you want
    to say!">
    <cfcatch type="foo.bar.custom">
    Do something special here!
    </cfcatch>
    <cfcatch type="Any">
    An Unknown error has occured!
    </cfcatch>
    </cftry>
    If you're not sure of the error that is being thrown, dump
    the cfcatch and grab the first part of the stack trace and then
    recode using that error type in your cfcatch block.
    Here's an example of catching an invalid file format upload
    with cffile.
    <cftry>
    <cffile action="upload" destination="#pathInfo#"
    fileField="imagefile" nameconflict="makeunique" accept="image/jpg,
    image/jpeg, image/png, image/eps, image/tif, image/gif,
    application/pdf" >
    <cfcatch
    type="coldfusion.tagext.io.FileTag$InvalidUploadTypeException">
    Invalid File Type
    </cfcatch>
    </cftry>

  • How to search for a particular word in a string?

    How to search for a particular word in a string?
    thanks for your help....

    This works fine.
    public class Foo {
        public static void main(String[] args) {
        String s = "Now is the time for all good...";
        String s2 = "the time";
        System.out.println(s.contains(s2));
        System.out.println(s.contains("for al"));
        System.out.println(s.contains("not here"));
    }output:true
    true
    falseYou must have something else wrong in your code.
    JJ

  • How to search for upper/lower case using string using JAVA!!!?

    -I am trying to write a program that will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter 'e' appears.
    -I also have to use a JOptionPane.showMessageDialog() to tell the user how many upper and lower case e's were in the string.
    -This will be repeated until the user types the word "Stop". 
    please help if you can
    what i have so far:
    [code]
    public class Project0 {
    public static void main(String[] args) {
      String[] uppercase = {'E'};
      String[] lowercase = {'e'};
      String isOrIsNot, inputWord;
      while (true) {
       // This line asks the user for input by popping out a single window
       // with text input
       inputWord = JOptionPane.showInputDialog(null, "Please enter a sentence");
       if ( inputWord.equals("stop") )
        System.exit(0);
       // if the inputWord is contained within uppercase or
       // lowercase return true
       if (wordIsThere(inputWord, lowercase))
        isOrIsNot = "Number of lower case e's: ";
       if (wordIsThere(inputword, uppercase))
         isOrIsNot = "number of upper case e's: ";
       // Output to a JOptionPane window whether the word is on the list or not
       JOptionPane.showMessageDialog(null, "The word " + inputWord + " " + isOrIsNot + " on the list.");
    } //main
    public static boolean wordIsThere(String findMe, String[] theList) {
      for (int i=0; i<theList.length; ++i) {
       if (findMe.equals(theList[i])) return true;
      return false;
    } // wordIsThere
    } // class Lab4Program1
    [/code]

    So what is your question? Do you get any errors? If so, post them. What doesn't work?
    And crossposted: how to search for upper/lower case using string using JAVA!!!?

  • How to search for a particular pattern in a string

    Hi,

    Hi ,
    How to search for a particular pattern in a string?
    I heard about java.util.regex; and used it in my jsp program.
    Program I used:
    <% page import="java.util.regex"%>
    <% boolean b=Pattern.matches("hello world","hello");
    out.println(b);%>
    I run this program using netbeans and am getting the following error message.
    "Cannot find the symbol : class regex"
    "Cannot find the symbol : variable Pattern "
    How to correct the error?

  • How to search for perticular substring in given string.

    Hi, Can any one tell me how to search for perticular substring in given string.
    example:
    I have to search for CA in given Order type it may be CA10 or CA15. Please Do the needful.

    Hi Aniruddha,
    check this...
    Data var string,
    var = 'India'.
    search var for 'Ind'.
    if sy-subrc = 0.    " var having ind
    Message 'Ind found' type 'I'.
    else  .            "var not having ind
    Message 'Ind not Found' type 'I'.
    endif.
    thanx
    bgan.

  • How to Search for "(" error  in a string?

    I am trying to search for "(" in a string, however the compiler thinks that I searching for a regular expression, and fails.
    Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed group near index 1
    Please help me find a way to search for "(" in a string.
    Example:
    String test="This is a test.";
    if (test.matches("(")){
    System.out.println("There is a match")
    I also tried:
    test.matches("\050")
    and test.matches("\(")
    Thank you!

    I also tried:
    test.matches("\050")
    and test.matches("\(")For this particular problem, I think indexOf is a more appropriate solution. However, for future reference, I think what you want to do for parentheses is escape the backslash, not the bracket.
    i.e.
    test.matches("\\(");

  • How to search for exact string?

    Is there any way to search for the text string exactly as I enter it? Like 'exact search' in the OSS notes?
    For example, I'm trying to find the forum posts regarding the Excel 2007 file format XLSX. By XLSX the search finds hundreds of entries, but most of them are not even close. For example, this was one of the top results: /thread/1078918 [original link is broken]
    Why is it getting picked up when 'xlsx' doesn't even appear there? We are frequently complaining about the users who don't use search before posting, but, frankly, if it works like this, I can't blame them...

    >
    Jelena Perfiljeva wrote:
    > Why is it getting picked up
    >
    => https://forums.sdn.sap.com/search.jspa?threadID=&q=%22Whyisitgettingpicked+up%22&objID=f40&dateRange=all&numResults=15&rankBy=10001
    "Why is it getting picked up"
    I regularly use this to (re)find threads where I remembered a specific comment or even spelling mistake.
    Perhaps a better option in your case would be to use an AND between individual terms.
    I generally tend to edit the search string parameters directly, as it seems to cache previous results and do a search within a search. That might be an option for you as well though.
    Cheers,
    Julius
    Edited by: Julius Bussche on Jul 10, 2009 11:38 PM

  • How to search for file in jsp page

    i need help on how to search for a file in a folder where there is a lot of subfolder.like how u search in a document in windows. i need a complete codes in jsp page.
    thank you in advance.
    Message was edited by:
    n_dilah

    no i need to do a search engine in jsp page which is the j2ee.
    i type smth than tat file from any folder will appear the same way when u need to search your file in a document in windows.
    well can u nice people tell me where i can get the codes bcos i stinks when it come to programming.
    thank you very very very much.

  • How to search for a BADI in a transaction

    Hi All,
    Please let me know the steps to find a BADI for a transaction.
    Thanks,
    Jaffer Ali.S

    check this.
    u can find BADI's in different ways...
    1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..
    2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    The simplese way for finding BADI is
    1. chooes Tcode Program & package for that Tcode.
    2. Go to Tcode se18
    3. Press F4
    4. search by package or by program.
    Regards
    Kiran Sure

  • How To Search For a Specific File name?

    Hello Everybody
    How To Search For a File Like NewFile.txt in a Root Like C:\\
    And If The File Is Found Open It And Write In It?

    http://forum.java.sun.com/thread.jspa?threadID=5194090&messageID=9763314

  • How to search for a fields ?

    Hello,
    I know it's an easy question but I've not find, how to search for a fields in Database on CR XI R2 ?
    Thanks in advance

    Hi Alexandre
    Do you want to see which database fields you have inserted in Crystal Reports and in which section you have inserted what fields?
    If yes then
    -open formula editor
    -In the right side pane expand Formatting Formulas.
    -Expand all the sections one by one and it will show you database fields,formulas and all the objects used in the sections.
    Hope this will clarify your doubts.
    Regards
    Asha.

Maybe you are looking for

  • Black Screen with Apple Logo?( Why)

    I have had my ipod touch (2nd generation) for 3 months. One day i was at school using my ipod and my battery ran out so i put it in my backpack. After school i plugged my Ipod into my computer and i got the red battery icon. I knew i had to wait 10 m

  • Adobe Prof 7 problems with Windows 7 - 64 bit

    My laptop crashed and I just purchased a new comptuer with Windows 7 - 64 bit.  Now have 2 problems with Adobe: #1 When I right click on a web site to save as PDF, it won't work. There is no error, no response.  Just doesn't do anything #2 If I go to

  • Operation_no_authorization

    Hi, I have created an RFC enabled Function module  that post SKF quantities and sends an email using another fm SO_DOCUMENT_SEND_API1. When I run this RFC FM in se37 i was able to post and send email. But when it is triggered by non-sap application u

  • 8.1.6 (Thin) drivers with J2EE???

    Hello all, I am trying to use the 8.1.6 THIN drivers as an XA datasource in J2EE. Has anyone else made this work? I keep getting a ClassCastException thrown while starting the J2EE server. It DOES work if I create an older NON-XA datasource, so I kno

  • Mac Pro randomly goes into sleep mode

    My (mid 2010) Mac Pro, OS X.6.8, randomly goes into sleep mode and I can't wake it, have to power it off and reboot. Just started to the best of my knowledge Friday (Jan 6, 2012) I've had it happen surfing the web in Safari, while working on an illus