Multiple Word Search

Does anyone know how i can search a coloumn using multiple words without using string tokenizer I get all the values in the table everytime as it searches using " " unless you enter a string in every section. If you just want to search for one word it still displays every value in the table. The code is below
try {
StringTokenizer searchtoken = new StringTokenizer(searchwords,",");
String s1 = searchtoken.nextToken();
String s2 = searchtoken.nextToken();
String s3 = searchtoken.nextToken();
String s4 = searchtoken.nextToken();
String s5 = searchtoken.nextToken();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(
data, "", "");
Statement st = conn.createStatement();
searchwords = searcharea.getText();
ResultSet rec = st.executeQuery(
"SELECT * "+
"FROM data "+
"WHERE Annotation LIKE '%"+
s1+
"%' OR" +
" Annotation LIKE '%" +
s2 +
"%'OR"+
" Annotation LIKE '%" +
s3 +
"%'OR" +
" Annotation LIKE '%" +
s4 +
"%'OR" +
" Annotation LIKE '%" +
s5 +
while(rec.next()) {
//System.out.println(rec.getString("Location"));
searchBox.addItem(
rec.getString("Location") + " " +
rec.getString("Start_Time") + " " +
rec.getString("End_Time") + " " +
(rec.getString("Annotation")).toUpperCase()
st.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(frame, "The search criteria entered is not in correct format");
} catch (Exception e) {
JOptionPane.showMessageDialog(frame, "The search criteria entered is not in correct format");
}

Does anyone know how i can search a coloumn using
multiple words without using string tokenizer I get
all the values in the table everytime as it searches
using " " unless you enter a string in every section.
If you just want to search for one word it still
displays every value in the table. That is how databases work.
If you don't want to search on a field then you must not include it in the clause.

Similar Messages

  • How to use synonyms on multiple word search ?

    We use context with multiword search like this one :
    select * from my_table where contains(my_text,'the small building near the river')>0
    Now we have specific synonyms in a thesaurus. How do we write the contains clause ?
    contains(my_text,'syn(the,thes) and syn(small,thes) and syn(building,thes) and syn(near,thes) and syn (river,thes)')>0 does not fin the synonym for "small building"="house" for instance
    contains(my_text,'syn(the small building near the river,thes)')>0 does only for synonyms on the full sentence.
    More generally is there an Oracle Document which describes how to use SYN, FUZZY and combine them, since
    the reference documentation gives only limited information on this ?
    Have a nice day

    The thesaurus functionality is not currently built for stuff like this.
    if you want to combine fuzzy and thesaurus, I am assuming you want to do fuzzy first, to correct any misspelling,
    then thesaurus on the "corrected" spellings? You'd have to do something like:
    1. take the query and run ctx_query.explain to break it down and do the fuzzy expansion
    2. work through the fuzzy expansion and build a new query string by sticking SYN() around each
    expanded word
    As for thesaurus expansion and phrase, these are not compatible. Thesaurus expansions use "," and "|", and so
    you cannot have a phrase of thesaurus expansions.
    I see what you're getting at, but you would need sub phrase detection, phrase equivalence, etc., which is
    currently beyond the thesaurus function capability.
    You can use themes (ABOUT) on phrases, and it will do something like what you are describing. You might want
    to check that out.

  • 10G-form: How to do MULTIPLE WORD OR SINGLE WORD SEARCH at ITEM?

    I am using 10G DB + 10G Form Builder.
    I've 'database_item' where I am storing multiline text data.
    I want to do MULTIPLE WORD OR SINGLE WORD SEARCH at this item through FORM.
    I've tried by creating the following NON Database Items on the form:
    - multiline_search_text_item, and
    - multiline_result__text_item
    And then writing execute_query in KEY-NEXT-ITEM trigger.
    I've also tried using this in the POST-TEXT-ITEM at multiline_search_text_item:
    select table.database_item into :multiline_result__text_item from table where multiline_search_text_item = :multiline_search_text_item;
    Pl help me asap.
    Gaurav

    What you want to do is not clear.
    The query you wrote will select records where the table contains exactly what has been written in the search item. You can use LIKE and a wildcard search to find records which contain the search text:
    select table.database_item into :multiline_result__text_item
    from table
    where multiline_search_text_item LIKE '%'||:multiline_search_text_item||'%';
    You can use UPPER to make this case insensitive:
    select table.database_item into :multiline_result__text_item
    from table
    where Upper(multiline_search_text_item) LIKE Upper('%'||:multiline_search_text_item||'%');
    But I suspect you want either to match the individual words in the search text to individual words in the database multiline field, or find records where the search words appear (not necessarily as whole words). In that case, check out the following:
    -- set up a table (multiline and various whitespaces)
    DROP TABLE t;
    CREATE TABLE t AS
    SELECT
      ROWNUM rn,
      owner||Chr(9)||object_name||Chr(160)||subobject_name||'    '||object_id||' '||
      data_object_id||Chr(10)||object_type||' '||created||' '||last_ddl_time||' '||
      timestamp||' '||status||' '||temporary||' '||generated||' '||secondary AS col
    FROM all_objects;
    -- check the format of the multiline text item (col)
    SELECT * FROM t WHERE ROWNUM < 4;
    -- a type for the function below
    CREATE TYPE string_tab AS TABLE OF VARCHAR2(255);
    -- this function takes a string and cuts out each word, idetifying words
    -- as being separated by any whitespace.  it returns a collection
    CREATE OR REPLACE FUNCTION string_to_tab(
      p_string IN VARCHAR2) RETURN string_tab IS
      l_string LONG DEFAULT
        RTrim(regexp_replace(p_string,'[[:space:]]+',' ')) || ' ';
      l_data string_tab := string_tab();
      n NUMBER;
    BEGIN
      LOOP
        EXIT WHEN l_string IS NULL;
        n := InStr(l_string, ' ');
        l_data.extend;
        l_data(l_data.Count) := LTrim(RTrim(SubStr(l_string, 1, n - 1)));
        l_string := SubStr(l_string, n + 1);
      END LOOP;
      RETURN l_data;
    END string_to_tab;
    -- selecting from t where ANY of the words in the search text has
    -- a match in the multiline field (as a word or part of a word), so SYS
    -- matches to MDSYS and SYSTEM
    SELECT DISTINCT
      t.rn, t.col
    FROM
      t,
      (SELECT column_value
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE InStr(t.col,x.column_value) > 0;
    -- selecting from t where ALL of the words in the search text has
    -- a match in the multiline field (as a word or part of a word), so SYS
    -- matches to MDSYS and SYSTEM
    SELECT rn, col FROM(
    SELECT
      t.rn, t.col, cnt_x, Count(*) cnt
    FROM
      t,
      (SELECT column_value , Count(1) over(PARTITION BY 1)cnt_x
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE InStr(t.col,x.column_value) > 0
    GROUP BY t.rn, t.col, cnt_x
    WHERE cnt = cnt_x;
    -- selecting from t where ANY of the words in the search text
    -- match a word in the multiline field, so SYS matches only to SYS
    SELECT DISTINCT
      t.rn, t.col
    FROM
      t,
      (TABLE(CAST(string_to_tab(t.col) AS string_tab))) t2,
      (SELECT column_value
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE t2.column_value = x.column_value;
    -- selecting from t where ALL of the words in the search text
    -- match a word in the multiline field, so SYS matches only to SYS
    SELECT rn, col FROM(
    SELECT
      t.rn, t.col, cnt_x, Count(*) cnt
    FROM
      t,
      (TABLE(CAST(string_to_tab(t.col) AS string_tab))) t2,
      (SELECT column_value , Count(1) over(PARTITION BY 1)cnt_x
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE t2.column_value = x.column_value
    GROUP BY t.rn, t.col, cnt_x
    WHERE cnt = cnt_x;For your application you would replace 'SYS INDEX' with a variable (the search field). You can use upper() and wildcards for case insensitive & 'fuzzy' searches. You might need to modify the function so it removes other delimiters such as commas and colons.

  • Searching for multiple words

    Wanted to ask if you knew of a script I could use or any other way to search a document for any words or phrases that appear in a specific list and highlight the word or phrase if it appears in the Pages doc. I'm using Word 2008 on a Mac. For instance, my list could contain the words 'solicitor' or 'lawyer' but also the phrase 'employment unfair dismissal'. My list has about 100 words and phrases that I need to search for in each Pages document. Ideally the script or other method would highlight in the Pages doc any of the words or phrases I am searching for. Thanks, Dave.

    Hi,
    No. My list looks like this:
    Contact Law
    Solicitor
    Solicitors
    Lawyer
    Lawyers
    Legal advice
    Specialist solicitor
    Specialist solicitors
    Barrister
    Barristers
    Employment solicitor
    Employment solicitors
    Employment lawyer
    Employment lawyers
    Employment law
    Employment law solicitor
    Unfair dismissal
    Unfair dismissal claims
    Unfair dismissal claim
    Unfair dismissal solicitor
    Unfair dismissal solicitors
    Claim for unfair dismissal
    Claims for unfair dismissal
    Constructive dismissal
    Wrongful dismissal
    Wrongful dismissal claim
    Wrongful dismissal claims
    No win no fee employment law
    No win no fee employment lawyer
    No win no fee employment lawyers
    No-win, no-fee solicitor
    Plus maybe another 60 words or phrases. What I want to do is take the above list and check these words or phrases for how many times they appear in a Pages document. I can see how you can use the search feature in Pages for single words, but you can't put multiple words or phrases into the search field.
    Cheers,
    Dave.

  • Multiple words don't work in search field

    When I enter multiple keywords in any search field nothing shows up.
    Let's say I'm looking for pink flowers. If I enter 'flowers' I see all my flower shots, as soon as I enter a comma, all photos disappear. If I go ahead and add 'pink', I still don't see anything. This happens in any search field whether in the browser or within a HUD.
    If I use a HUD, add text fields and enter 'flowers' and 'pink', think I see pink flowers. If I use the keyword checklist in the HUD, I see pink flowers. But I can never use multiple words separated by commas.
    What's wrong? I've checked the Aperture Manual and can't figure out why the multiple word method doesn't work.

    I always use the keyword search panel in the HUD when I am looking for keyworded images...multiples work fine there. I suspect the "text" search field is parsed EXACTLY as it says, examining a string and looking for a match anywhere in the metadata. My suspicion is that the comma is being parsed as JUST THAT, a comma, rather than a search field separator.
    My 2¢
    cheers,
    david

  • Package search for multiple word string?

    Ok, im feeling really dumb, but how do I search for packages using multiple words in a single string?  For example if I do the command "pacman -Ss session manager" it will return a huge list of all packages with the word session and all packages with the word manager, but what i really want to see is the smaller list of only the packages that contain the entire exact string session manager.

    For me yaourt does the trick if you use ezzetabi's example ('session.*manager'). However, for 'session manager' only it doesn't.
    You could try packer (in AUR). I just tried all three of them and packer seems to also look for the two words together only if you use '... ...' only.

  • Search for multiple words in a field?

    is there a way to search for multiple words in a field? for example, if i have a metadata field called NOTES that contains the string "Joe and Bob created this version on Sunday" is there a way to search for "Sunday, Joe, Bob" and have it return the asset?

    Search using the "Matches Word" option instead of "Contains". That will limit your results to only assets that have a field value that includes all three of those terms. If they are not all included in the same field value, it will not return a hit. So if "Sunday" were in Keywords and "Joe" & "Bob" are in Notes, you would not get a hit for that search with "Matches Word".
    "Contains" searches for the contiguous string in any field on the assets.
    Further, if you add your Notes field to the Metadata Group "Asset Filter", it will appear in your advanced search options, asset subscription filters, and search expired responses. Then you can specifically limit the search to that field and choose from "Matches Word', "Contains", and several other search filters. Note that when you use "Matches Word" this way, you need to eliminate spaces from your comma delimited list of words or you will not get the search hits you want.

  • Searching multiple words within page separately

    1. I am searching within a page using the Find function.
    2. When I type in a search word, Find accurately highlights the word.
    3. I am trying to search multiple words at once, and have Find highlight them separately.
    E.g. Search for "motor OR cables" would search for "motor" and "cables" and not "motor cables" i.e. the search string has to be truncated to allow for each word to be searched separately.

    Hello,
    You can use the following Add-on and let me know if It helped your cause:
    https://addons.mozilla.org/en-US/firefox/addon/searchwp/
    If it did not help you,please get back to me. I will try to help you again.

  • How to pass multiple words as a search argument on the Acrobat Command Line?

    I am trying to launch Acrobat using a multi-word search parameter on a Windows XP box. However, Acrobat is stripping the spaces between words. For example, I am trying to load Acrobat and have it search for the phrase "vision changes" using a Command Line like this:
    C:\>"C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe" /A search="vision changes" c:\temp\theDocument.pdf
    When Acrobat loads, it shows the search panel with the phrase "visionchanges" in it. The space between the two words is gone and naturally it can't find the phrase.
    I have read both the PDF Command Line parameter documents I could find. This format works fine for URLs, but for Shelling Acrobat on the local system, it doesn't work because of the space stripping problem. I have tried lots of different variants of quote characters, escape characters, even HTML characters like "&nbps;", but nothing works.
    Does anyone have an answer?
    For the curious here are links to the two PDF documents I found that cover the command line arguments:
    http://www.adobe.com/devnet/acrobat/pdfs/PDFOpenParameters.pdf
    http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf
    Thanks,
    Robert

    Hey Robert,
    Did you note that in the "pdf_open_parameters.pdf" document, it says that the value of the Search parameter is treated as a list of (single) words, not as a string of words (phrase)?
    It says it explicitly: "You can search only for single words. You cannot search for a string of words."
    PS: I'm replying to your query as a sort of thank you for posting the links to those documents. It helped me to find the way of conditioning how to open a pdf.

  • When converting multiple word and excel docs to a combined PDF random pages have blue background in the finalized PDF.

    I have a user using Acrobat 10. It was installed two weeks ago and initially had no problems. Today she reported that when she tries to convert multiple word and excel docs by selecting them, and right clicking on them to select convert/combine to PDF, random pages in the finished PDF have a blue background. I did some searching online and can find no information about this problem. Can anyone here shed some light on this issue and maybe point me in the direction of a solution? Any help is appreciated. Thanks!

    Hi Gilad,
    So, something I didn't consider was that this could be a setting in the office docs. The reason I didn't consider this was be cause we tested multiple docs and had similar results each time. I went back and looked into this possibility and found a setting in word that was causing this issue. Although the word doc showed no page color when opened in word, if I went to "Page Layout" -> "Page Color", a shade of blue was selected. By selecting "No Color", and then converting/combining the docs to PDF we got the desired result. Thanks again for your reply!

  • Copy text out of multiple word documents

    Hi Guys,
    Just wondering if it is at all possible to copy ALL the text from multiple word documents and place it into one. So basically bringing 6+ documents into 1.
    I've done some google searches and have come a cross this:
    New-Object -comobject Word.Application
    But not sure if I can do what I want it to do. Any help/links would be a massive help.
    Cheers
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

    You sir have saved my bacon! Thank you!
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

  • GridView Sorting with multiple word in header

    Dear All
    we have dynamic GridView. we want to sort the gridview. we have multiple words in the header column like (Chicken Burger, Small Pizza , Chicken Roll etc). i m using below code but its giving me error on clicking header (Chicken Burger) like
    Cannot find column Chicken Inserts.
     protected void gv_SearchResults_Sorting(object sender, GridViewSortEventArgs e)
                 string Search= "SearchAllFOs";
            DataTable dtbl = ShowAllItemsData(SearchAllFOs);
            gv_SearchResults.DataSource = dtbl;
            gv_SearchResults.DataBind();
            if (ViewState["Sort Order"] == null)
                dtbl.DefaultView.Sort = e.SortExpression + " DESC";
                gv_SearchResults.DataSource = dtbl;
                gv_SearchResults.DataBind();
                ViewState["Sort Order"] = "DESC";
            else
                dtbl.DefaultView.Sort = e.SortExpression + "" + " ASC";
                gv_SearchResults.DataSource = dtbl;
                gv_SearchResults.DataBind();
                ViewState["Sort Order"] = null;
    Thanks and Best Regards Umair

    Hello Muhammad Umair 2756,
    Since we saw this GridViewSortEventArgs  https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewsorteventargs(v=vs.110).aspx
    Your project is actually a web project and please follow CoolDadTx's suggestion to post on ASP.NET forum.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Multiple Word Strings Using C++ in Xcode 2.2

    This is my first post and I'm happily a new member and hopefully a helpful one as well. I took a C++ programming class in school, decided to use Xcode and start doing programming again. However, I have this issue:
    I'm trying to use a string to read me what I've entered for the name of a person, of course once there is a space, the name ends. Here is my code...
    int main()
    int loannumber;
    string name;
    cout << "May I have your loan number please? ";
    cin >> loannumber;
    cout << "Your loan number is " << loannumber << endl;
    cout << "May I have your name please? ";
    cin >> name;
    getline (cin, name);
    cout << "Hello " << name << ".\n";
    Whenever it asks me for the name, I put the first and last name and it will only read the last name back to me.
    How can I get multiple word strings in C++ code? Can someone help me?
    Thank you!!

    Hi--
    Welcome to the Apple Discussions.
    You can do it if you rewrite your code something like this:
    #include <iostream>
    using namespace std;
    int main (int argc, char * const argv[]) {
    char ca[100];
    cout << "May I have your name please?\n";
    cin.getline(ca, 100);
    cout << "Hello " << ca << ".\n";
    return 0;
    }I got this tip from this page, which I found with a Google search. I really don't use C++, though, so I'm not exactly certain that's the "correct" way to go about doing this...
    charlie

  • Cptiavte 8 - the actions does not appear in proprerties when adding a word search widget - any clues please

    Are  there some bugs in captivate - the properties do not always show timings - is this the same for Actions on a word search widget?

    I understood perfectly your question. There is barely documentation about the learning interactions. I have been presenting last year at DevLearn about them with great success, but this year that presentation (even a workshop would be useful) was declined. And I never see any tutorial about them, no documentation in the Help etc.  Wondering why, because they offer some time saving functionality to make a course more engaging. In my last blog post I showed how the Scrolling TextArea Interaction (as widget it is called TextArea, name that is still visible for the interaction as well???) can be used for a Short Answer question with more functionality than the default one: Custom Short Answer Question - Captivate blog
    There is already the big confusion: why are there Widgets (they still are included) and Learning Interactions that both are pointing to widgets (hence the generic name), just to make the difference between those widgets that are SWF only and those that are compatible also with HTML5 output (the so-called Learning Interactions or Interactions)? Terminology is to say it very diplomatic, bit 'inconsistent'.
    But what I explained in this blog post about Widgets, the 3 categories, is also valid for the Learning Interactions: http://blog.lilybiri.com/using-captivate-widgets-some-tips
    You will see that static widgets cannot trigger Actions! Only the interactive widgets (and question) can do that. It is the same difference that exists for objects: non-interactive objects like text captions, images, cannot have actions attached to them, only the interactive objects (buttons, click boxes, TEB's, shape buttons). There is one hybrid object, the rollover slidelet. The Interaction you are pointing at, Word Search, is a static interaction, which means no actions and thus the Actions tab will not appear!
    Another blog post shows all the events that can trigger an action: Events and (advanced) Actions - Captivate blog
    As for your second question: in Captivate 6 all interactions were pausing at the first frame, and that caused a lot of problems (audio not playing is one of them). For that reason the behavior changed radically from 7  on: now they are not pausing at all. That means thaty you need to insert an interactive object with a pausing point like a button (think about a Next button?), click box, shape button...
    Oh yes, static widgets cannot have score attached to them, there is no real way to check if the WordSearch widget has been used? It is an exception, because the other game interactions have an associated variable, are interactive, can trigger actions and can have a score (but that is another long story).
    Think I have spent already too much time answering, to try to fill in the gaps in the documentation. I could write multiple articles on Interactions, want to provide more information but free things are not considered valuable at all. Why should I bother

  • Multiple Keyword Searching

    I am having trouble doing multiple keyword searches in aperture. Say for instance I tagged a photo with the word "Bob" and then with the word "Park". If I search for just Bob or just Park, I get all photos tagged with one or the other keyword. But if type into the keyword search bar: Bob, Park. No photos come up. I have tried several different ways of searching keywords. Anyone having the same problem or know how to fix it?

    The same is written in the [Aperture3 User Manual|http://documentation.apple.com/en/aperture/usermanual/index.html#chapter =14%26section=7%26tasks=true]; it doesn't work in Ap3 either. (The comma seems to be taken a literal character, not as a separator.)
    Ap3 lets one add additional filter rules, so that one could have two Text rules. (I never used Ap2.)
    Ap3 limits the keyword list to those keywords present in the currently selected container(s). So to at least check what you are doing -- if Ap2 does the same -- select or filter to a number of images with just a handful of keywords total, and see what you find out.
    Nice to see the sun for once.

Maybe you are looking for

  • How to create a Custom Screen for executing a report in the backend ?

    Hello Everyone, I have a requirement to develop a Custom Application on the Cloud to capture few fields from user and trigger an execution of a report in the background in CRM. There is no need to display any results after the triggering execution. J

  • How to restore the Main Drive from Time Machine after replacement

    I have a Late 2008 PowerBook Pro. I have a 2TB external drive for Time Machine. I replaced the main drive with a 1 TB drive and thought that i could restore from the Time Machine. I have another external drive that has an earlier OS on it. It lets me

  • Ordering new Mac Pro. Would like some advise please.

    Okay, here we go. I am a freelancer who shoots in 1080i and 720p using a JVC 700 U camera with really good glass. in a small market. So bringing the media in is a piece of cake. I do not see me going to 2K or 4k anytime soon. I produce a weekly hour

  • Report Generation Overwrite

    Hello! I'm having serious trouble using the Report Generation Toolkit. LabVIEW 8.6, RGT 1.1.3, Word/Excel 2007. The starting premise is that we are taking data, sending it to a waveform graph, then we want to write the picture to a file (either Word

  • HT1414 itunes page blank for iphone 4

    Hello, I just restored my Iphone4.  After it was done, now in Itunes, it recognizes the phone when plugged in, however the itunes iphone page is blank. This phone is straight from the apple store, no modifications, jailbreaking or changes.  Anyone kn