CONTAINS and searching for words with an apostrophe

I have a CONTEXT index in place, and I'm trying to search for the word
JOHN'SHow do you go about going that, I tried both
JOHN'S
JOHNSand neither worked.
--=Chuck

How are you doing your search?
SQL> create table test1 (
  2  a1 number,
  3  a2 varchar2(20));
Table created.
SQL> insert into test1 select level, 'Line '||level from dual connect by level < 500;
499 rows created.
SQL> insert into test1 values (1000, 'JOHN''S');
1 row created.
SQL> create index context_index on test1 (a2) indextype is ctxsys.context;
Index created.
SQL> select * from test1
  2  where contains (a2, 'JOHN''S') > 0;
        A1 A2
      1000 JOHN'S
SQL> select * from test1
  2  where contains (a2, 'JOHNS') > 0;
no rows selected
SQL> select * from test1
  2  where contains (a2, 'JOHN') > 0;
        A1 A2
      1000 JOHN'S

Similar Messages

  • Need to search for words with similar meaning

    HI,
    I want to search for words which are similar in meaning,
    for example, search with the keyword LIME should give LIME , LEMON etc.
    Can it be done using the inbuilt thesaurus?

    I don't know how similar the example that you provided is to your actual problem.  Synonyms are not the only relations that you can set.  You an also use related terms and hierarchies using broader and narrower terms.  In the following example, I have created citrus as a broader term and created lemon, lime, and orange as narrower terms underneath citrus.  I have them demonstrated how you can query to return all items from the same category that lemon is in, by first finding the broader term citrus above it, then searching for all narrower terms underneath that.  I have included some intermediary results that you don't need to run, just for better understanding of how the query is formed.
    SCOTT@orcl12c> create table test_tab
      2    (test_col  varchar2(60))
      3  /
    Table created.
    SCOTT@orcl12c> insert all
      2  into test_tab values ('lemon')
      3  into test_tab values ('lime')
      4  into test_tab values ('orange')
      5  into test_tab values ('toaster oven')
      6  select * from dual
      7  /
    4 rows created.
    SCOTT@orcl12c> create index test_tab_idx on test_tab (test_col) indextype is ctxsys.context
      2  /
    Index created.
    SCOTT@orcl12c> begin
      2    ctx_thes.create_thesaurus ('test_thes');
      3    ctx_thes.create_relation ('test_thes', 'lemon', 'bt', 'citrus');
      4    ctx_thes.create_relation ('test_thes', 'lime', 'bt', 'citrus');
      5    ctx_thes.create_relation ('test_thes', 'orange', 'bt', 'citrus');
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> variable g_search varchar2(100)
    SCOTT@orcl12c> exec :g_search := 'lemon'
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> select ctx_thes.bt (:g_search, 1, 'test_thes') from dual
      2  /
    CTX_THES.BT(:G_SEARCH,1,'TEST_THES')
    {LEMON}|{CITRUS}
    1 row selected.
    SCOTT@orcl12c> select 'nt(' ||
      2            replace (ctx_thes.bt (:g_search, 1, 'test_thes'), '|', ', 1, test_thes)|nt(')
      3            || ', 1, test_thes)'
      4  from  dual
      5  /
    'NT('||REPLACE(CTX_THES.BT(:G_SEARCH,1,'TEST_THES'),'|',',1,TEST_THES)|NT(')||',
    nt({LEMON}, 1, test_thes)|nt({CITRUS}, 1, test_thes)
    1 row selected.
    SCOTT@orcl12c> select * from test_tab
      2  where  contains
      3            (test_col,
      4            'nt(' ||
      5            replace (ctx_thes.bt (:g_search, 1, 'test_thes'), '|', ', 1, test_thes)|nt(')
      6            || ', 1, test_thes)') > 0
      7  /
    TEST_COL
    lemon
    lime
    orange
    3 rows selected.

  • Searching for words with dot  in the context index.

    Hi ,
    We have a context index that uses a following BASIC_LEXER
    drop_preference (c_lexer_pref);
    ctx_ddl.create_preference(c_lexer_pref, 'basic_lexer');
    ctx_ddl.set_attribute(c_lexer_pref, 'base_letter', 'YES');
    ctx_ddl.set_attribute(c_lexer_pref, 'whitespace', '()"`/');
    ctx_ddl.set_attribute (c_lexer_pref, 'index_stems', 'english');
    When user searches for "OAR" , oracle does not find "O.A.R'"
    Can someone help me understand why oracle is not able to find the "O.A.R" when OAR is being searched.
    Thanks for your help.

    You need to use skipjoins to tell it to skip the periods, as shown below.
    scott@ORA92> drop table your_table
    2 /
    Table dropped.
    scott@ORA92> exec ctx_ddl.drop_preference ('c_lexer_pref')
    PL/SQL procedure successfully completed.
    scott@ORA92> begin
    2 ctx_ddl.create_preference ('c_lexer_pref', 'basic_lexer');
    3 ctx_ddl.set_attribute ('c_lexer_pref', 'base_letter', 'YES');
    4 ctx_ddl.set_attribute ('c_lexer_pref', 'whitespace', '()"`/');
    5 ctx_ddl.set_attribute ('c_lexer_pref', 'index_stems', 'english');
    6 ctx_ddl.set_attribute ('c_lexer_pref', 'skipjoins', '.');
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    scott@ORA92> create table your_table
    2 (your_column varchar2(30))
    3 /
    Table created.
    scott@ORA92> insert into your_table values ('OAR')
    2 /
    1 row created.
    scott@ORA92> insert into your_table values ('O.A.R')
    2 /
    1 row created.
    scott@ORA92> create index your_index
    2 on your_table (your_column)
    3 indextype is ctxsys.context
    4 parameters ('lexer c_lexer_pref')
    5 /
    Index created.
    scott@ORA92> select * from your_table
    2 where contains (your_column, 'OAR') > 0
    3 /
    YOUR_COLUMN
    O.A.R
    OAR
    scott@ORA92>

  • PDF Search: Escape chars / search for words containing dots

    Hello,
    i'm trying to do a search for ip adresses in a pdf document - eg for "10.100.0.1" - but it seems that adobe reader doesnt cope with the included dots.
    Is there a way to search for words containing dots? Maybe some way of escaping the dot?
    Thanks,
    Moritz

    Reader can find dots just fine. There's probably something going on with your file, like font issues or spaces between the text, or something like that.

  • How do I search for lines with a particular pattern and delete them when a match occurs

    How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string. 

    How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string. 
    Lines in what? And what language are you using to develop with?
    Are the lines in a text file? A RichTextBox? A TextBox? Some other control? A List(Of String)?
    Is there some expectation by you that by providing what you wrote in your question post that the knowledge in your mind about what you are thinking about will mysteriously emanate to anybody reading your post so all of the sudden your knowledge will
    become their knowledge and they will be able to provide you with an answer as they will suddenly understand what you are trying to do? Because that's probably impossible. Most people try providing enough information in a question so anybody, even stupid people
    like me, can understand what they want. Maybe you should try that. As well as selecting an appropriate forum for your question in the future. Usually a question like this is related to programming in a particular language therefore a language forum may be
    a good choice. Or not.
    La vida loca

  • HT4623 I have just updated my i phone 4s with the new ios 6 software and most of my apps have disapeared when i got to the app store and search for an app i cant find i click on it and it says the app is installed. Iff i double click on it it opens. Any i

    I have just updated my i phone 4s with the new ios 6 software and most of my apps have disapeared when i got to the app store and search for an app i cant find i click on it and it says the app is installed. but i cant find it in my apps if i double click on it it opens. Any ideas?
    Thanks Pete

    I have the same problem.  Some of my purchased songs are missing also.

  • With ios6 the app store closes everytime i try and search for an app

    ok so everytime i try and search for an app on the app store through my itouch it closes out... it has only done it since i updated to ios6

    Common problem for some users after updating to iOS 6. No known solutions yet.

  • Unable to search for words in a pdf document

    I am using Adobe Reader Ver 10.1.1 (All updates)
    I have a pdf document in which I am unable to search for words. No words in the document are found even though they do exist. If I copy a word from within the document and paste it into the search criteria then instead of getting the word that I copied, I get substitute characters and it can in fact find these characters as the word being searched.
    The document is a catalog and can be downloaded from the following URL.
    http://www.carbatec.com.au/getcatalogue?zenid=d1cuvbat0ois0g37r0r33vnah1
    I will appreciate any help as to why I cannot search for words in the document.

    Thank you Dave Merchant and try67 for your responses. As per my previous post, I contacted the company re the catalogue and they have responded favourably. I'll include their response because it gives the reason for the search failure as document compression which you might find interesting. I'll await their new catalogue and see if they have fixed the problem.
    Company response:
    Thank you very much for your input.  And yes, you are correct, the compression we used for the current catalogue's PDF format does strip out text included in the catalogue.  We used the compression settings we did with the intention of minimising download time, however I take your point about including text for search purposes (which I also utilise when I'm scanning through PDFs).
    We will actually be posting out our new catalogue next week and we'll release the new PDF version on the website at the same time.  I've asked our graphic designer to ensure that the PDF we use for the new catalogue includes searchable text.

  • Can't search for words anymore after saving PDFs in Preview

    Hi everyone,
    I would love to use Preview for my day-to-day use of previewing PDFs + highlighting + setting annotations. However, once I have saved the pdf with Preview I can not search for words anymore. If I search for one letter only, I would get cryptic hits like "7;%! 2%8%P%8!".
    I am not sure, but I guess when preview saves the pdf using a Quartz PDF context, something happens with the index, or the underlying the font structuring.
    Does anyone have had experience with these kinds of troubles?
    Thanks in advance,
    Heinrich

    Hi, thanks for answering quickly, and the heads up on that other thread.
    It undoubtedly has to do with the annotations or mark ups (the last, in my case).
    In the linked-to thread they end by suggesting that it's because it's has "commenting not allowed" when you see it
    using Adobe Reader, File > Properties > Security says Commenting: Not Allowed.
    However, some documents with "commenting not allowed set in Adobe Reader I can highlight or annotate fine, without it messing up after saving.
    Besides, any document I save as pdf even from Word, will say commenting not allowed in Adobe Reader. So if even my own documents are not highlight- or annotate-able without garbling the text, what documents would these functions be for, then?
    I think what somebody mentioned in the other thread about character encodings hold some truth, I see it in documents in Danish with æ ø and å (however, not all!), but not in English-only docs (yet. Have any of you?).
    Thanks in advance,
    - Alexander

  • I need autocomplete  for search for words in a txt. file

    i am not so good in java.
    I have a running code for search in text with a txt. file (from user bluefox815).
    But I need a solution with autocomplete for search for words in a txt. file.
    test_file.txt (Teil des Inhaltes):
    Roboter robots
    Mechatronik mechatronics
    and so on
    Can you help me please.
    Here is the code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    * this program searches for a string in a text file and
    * says which line it found the string on
    public class SearchText implements ActionListener {
    private String filename = "test_file.txt";
    private JFrame frame;
    private JTextField searchField;
    private JButton searchButton;
    private JLabel lineLabel;
    private String searchFor;
    private BufferedReader in;
    public SearchText() {
    frame = new JFrame("SearchText");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    searchField = new JTextField(80);
    searchButton = new JButton("Search");
    // this is used later in our actionPerformed method
    searchButton.setActionCommand("search");
    // this sets the action listener for searchButton, which is the current class
    // because this class implements ActionListener
    searchButton.addActionListener(this);
    lineLabel = new JLabel("nach dem Fachbegriff suchen");
    public void createGUI() {
    JPanel topPanel = new JPanel();
    topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.X_AXIS));
    JPanel bottomPanel = new JPanel();
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    topPanel.add(searchField);
    topPanel.add(searchButton);
    bottomPanel.add(lineLabel);
    mainPanel.add(topPanel);
    mainPanel.add(bottomPanel);
    frame.getContentPane().add(mainPanel);
    frame.pack();
    frame.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    // now we get the action command and if it is search, then it is the button
    if ("search".equals(e.getActionCommand())) {
    searchFor = searchField.getText();
    searchTheText();
    private void searchTheText() {
    // I initialize the buffered reader here so that every time the user searches
    // then the reader will start at the beginning, instead of where it left off last time
    try {
    in = new BufferedReader(new FileReader(new File(filename)));
    } catch (IOException e) {
    String lineContent = null;
    int currentLine = 0;
    // this will be set to true if the string was found
    boolean foundString = false;
    while (true) {
    currentLine++;
    // get a line of text from the file
    try {
    lineContent = in.readLine();
    } catch (IOException e) {
    break;
    // checks to see if the file ended (in.readLine() returns null if the end is reached)
    if (lineContent == null) {
    break;
    if (lineContent.indexOf(searchFor) == -1) {
    continue;
    } else {
    lineLabel.setText(String.valueOf(lineContent));
    foundString = true;
    break;
    if (!foundString)
    lineLabel.setText("Es kann kein Fachbegriff gefunden werden.");
    try {
    in.close();
    } catch (IOException ioe) {
    public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    new SearchText().createGUI();
    }

    Markus1 wrote:
    But I need a solution with autocomplete for search for words in a txt. file.What is your question? What have you tried so far? What are you having difficulty with?
    Mel

  • PDF search for term with space yields term with hyphen

    Hi,
    I've encountered what seems to be an unpleasant problem in PDF searches, and am wondering whether it's known or has a solution.
    In words, the problem is that when I perform a PDF search for a term with a space I get results for the term with a hyphen substituted for the space.
    Example: If I open this PDF (technical document from Freescale Semiconductor), and search for the term
    D cache
    I expect to find occurrences of the term "D cache", space and all. The term is in fact not in the PDF -- but the PDF search reports several instances found. Trouble is, the term it finds is
    D-cache
    This is unexpected, because a space is not the same as a hyphen. And this causes me problems, because I can't search for the space-separated term without hitting "false positives".
    I've tried this on Acrobat 9 Professional, Reader 9, and Acrobat 10 Professional, on Windows XP and Windows 7, using both quick search and advanced search with all possible permutations of options. The result is nonetheless the same.
    If you know of a solution to this problem, I would appreciate it if you shared it. Thank you!

    ... It looks like the hyperlink to the document did not post properly; the link is:
    http://cache.freescale.com/files/32bit/doc/prod_brief/MPC5676RPB.pdf?fsrch=1&sr=1

  • Searching for words in Album names

    My iPhoto search function is unable to find words that are in the names of newly-created Albums. It can find words in the names of albums I created some time back but not in new one.
    This is what I do:
    1) Select several photos.
    2) Push the plus sign to create a new album.
    3) Give the album a unique name like "dazzler"
    4) Select the tab to view all photos in the library.
    6) Do a search for "dazzler", but nothing comes up.
    Very strange.
    If I search for words in libraries I created a week ago, they show up fine.
    I've already reindexed Spotlight, restarted, and tried various other general things, all to no avail. Any advice would be appreciated.
    Thanks,
    Matthew

    I can confirm your problem. Report the bug at http://www.apple.com/feedback/iphoto.html as will I.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Searching for pictures with 2 keywords

    Hi guys, I was just wondering if there is way to search for files with two specific keywords.
    Lets say that I want to find picture that contains both Nicol and Brandy keywords. Not just one or the other. Is there any way to that in Bridge CS5?
       Thanks for your help.  Charles

    Yes, yes there is.  You need to use the Find function (Ctrl F in Windows).
    With the Find window you will see a + at the right edge of Criteria line.  Click that and it will add lines.
    Select the Match for "All criteria met".

  • Search for word/phrase by ctrl+shift+F

    ctrl+shift+F
    One can enter here  the file/folder path the search for word/phrase should be made.
    But length of this control element is really limited.
    If the chosen path is very long, with lot of folder levels, longer than the control element is capable to show it,
    the path string is truncated. Truncation in its middle part.
    Nobody is able to see how exactly the path is, after it has been shortened.
    And now, please imagine that there are several similar paths on the disc.
    They differ by theirs middle section only.
    Now assume the search needs 3 hours.
    1. After 3 hours of search run user can't say which folder of all similar folders he has chosen for last search operation.
    After search completes user is no able to check, which path the search ran in.
    2. If new search in some other folder but in a folder located close to the previous one is aimed  the user
    has to follow the whole path from the disc root - job intensive task.
    Adobe Reader should use the previous search path as start point of new search path selection.
    The full-feature product Adobe Acrobat probably also affected.

    Hi vmartin01,
    I tried to check at my end and it works fine at my end.
    Regards,
    Ajlan Huda.

  • How can I have one thing open in Safari on my MacBook Pro and search for another thing in Safari without closing out of the other? For instance, How can I leave Pandora playing while I search Facebook?

    How can I have one thing open in Safari on my MacBook Pro and search for another thing in Safari without closing out of the other? For instance, How can I leave Pandora playing while I search Facebook?

    With Safari open use the Command + T keyboard shortcut to open a new tab.
    Or, Command + N to open a new window.

Maybe you are looking for

  • ITunes won't copy music files to Media folder when songs are dragged

    I am trying add songs from my external hard drive to my iTunes Library. I have the following options checked: "Keep iTunes Media folder organized." "Copy files to iTunes Media folder when adding to library." In the past, I could just drag files from

  • Display Error message for items in ME21N

    Hi everybody, i made some controls for items order using the User-Exit EXIT_SAPMM06E_006. If the control don't pass, i display an error message using MESSAGE instruction. The probleme is when i'm doing it, the Error message is display in the task bar

  • Insert statement taking more time

    Hi, Insert happening very slow after sqlldr happening in my program. Please find the below workflow of my program. 1) SQLLDR will be called, it will insert around 4 lakhs records in 'TEMP" table using direct path load.Response time is good here. 2)Af

  • Jdeveloper 11g + decode syntax exception

    Hello, I am using Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536. When I add decode sql function in order by clause,following exception throws in Jdeveloper IDE. it looks like pattern issue,any clue?? SEVERE: exception visiting oracle.xml.parser.v

  • Bought dock adapter for classic 160GB and it doesn't fit

    Came in 3 pack, but all three are completely identical and all of them are too big.  Product number ma126g/a.  What do I do?