Special Characters in search terms and in data

I'm having a hard time making a decision about what types of special characters I should support in my Contains search.
I know that some of my data has dashes in it like '1034-AMFM' but if a user puts that in the search term it will be interpretted as a special character by OracleText correct?
What I have resorted to at the moment is stripping all special characters out of the users search terms but this severely limits the capabilities of Oracle Text and what I'm stuck with is a very basic search tool.
Is there a way to find a happy medium here?

You need to use a backslash, not a forward slash. The following demonstrates the behavior under different circumstances, such as specifying the hyphen as a printjoin or skipjoin or whitespace, which is the default, with and without escaping:
SCOTT@10gXE> CREATE TABLE test_tab (test_col  VARCHAR2 (30))
  2  /
Table created.
SCOTT@10gXE> INSERT ALL
  2  INTO test_tab VALUES ('1034-AMFM')
  3  INTO test_tab VALUES ('1034 AMFM')
  4  INTO test_tab VALUES ('1034AMFM')
  5  INTO test_tab VALUES ('95.1-FM')
  6  SELECT * FROM DUAL
  7  /
4 rows created.
SCOTT@10gXE> -- without specifying hyphen as printjoin or skipjoin or whitespace
SCOTT@10gXE> -- or continuation or punctuation or whatever:
SCOTT@10gXE> CREATE INDEX test_idx ON test_tab (test_col)
  2  INDEXTYPE IS CTXSYS.CONTEXT
  3  /
Index created.
SCOTT@10gXE> SELECT token_text FROM dr$test_idx$i
  2  /
TOKEN_TEXT
1034
1034AMFM
95.1
AMFM
FM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034-AMFM') > 0
  2  /
no rows selected
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034\-AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034{-}AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '{1034-AMFM}') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034 AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034AMFM') > 0
  2  /
TEST_COL
1034AMFM
SCOTT@10gXE> -- with hyphen as printjoin:
SCOTT@10gXE> DROP INDEX test_idx
  2  /
Index dropped.
SCOTT@10gXE> EXEC CTX_DDL.CREATE_PREFERENCE ('test_lex', 'BASIC_LEXER')
PL/SQL procedure successfully completed.
SCOTT@10gXE> EXEC CTX_DDL.SET_ATTRIBUTE ('test_lex', 'PRINTJOINS', '-')
PL/SQL procedure successfully completed.
SCOTT@10gXE> CREATE INDEX test_idx ON test_tab (test_col)
  2  INDEXTYPE IS CTXSYS.CONTEXT
  3  PARAMETERS ('LEXER test_lex')
  4  /
Index created.
SCOTT@10gXE> SELECT token_text FROM dr$test_idx$i
  2  /
TOKEN_TEXT
1034
1034-AMFM
1034AMFM
95.1-FM
AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034-AMFM') > 0
  2  /
no rows selected
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034\-AMFM') > 0
  2  /
TEST_COL
1034-AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034{-}AMFM') > 0
  2  /
no rows selected
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '{1034-AMFM}') > 0
  2  /
TEST_COL
1034-AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034 AMFM') > 0
  2  /
TEST_COL
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034AMFM') > 0
  2  /
TEST_COL
1034AMFM
SCOTT@10gXE> -- with hyphen as skipjoin:
SCOTT@10gXE> DROP INDEX test_idx
  2  /
Index dropped.
SCOTT@10gXE> EXEC CTX_DDL.DROP_PREFERENCE ('test_lex')
PL/SQL procedure successfully completed.
SCOTT@10gXE> EXEC CTX_DDL.CREATE_PREFERENCE ('test_lex', 'BASIC_LEXER')
PL/SQL procedure successfully completed.
SCOTT@10gXE> EXEC CTX_DDL.SET_ATTRIBUTE ('test_lex', 'SKIPJOINS', '-')
PL/SQL procedure successfully completed.
SCOTT@10gXE> CREATE INDEX test_idx ON test_tab (test_col)
  2  INDEXTYPE IS CTXSYS.CONTEXT
  3  PARAMETERS ('LEXER test_lex')
  4  /
Index created.
SCOTT@10gXE> SELECT token_text FROM dr$test_idx$i
  2  /
TOKEN_TEXT
1034
1034AMFM
95.1FM
AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034-AMFM') > 0
  2  /
no rows selected
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034\-AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034{-}AMFM') > 0
  2  /
TEST_COL
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '{1034-AMFM}') > 0
  2  /
TEST_COL
1034-AMFM
1034AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034 AMFM') > 0
  2  /
TEST_COL
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034AMFM
SCOTT@10gXE> -- with hyphen as whitespace:
SCOTT@10gXE> DROP INDEX test_idx
  2  /
Index dropped.
SCOTT@10gXE> EXEC CTX_DDL.DROP_PREFERENCE ('test_lex')
PL/SQL procedure successfully completed.
SCOTT@10gXE> EXEC CTX_DDL.CREATE_PREFERENCE ('test_lex', 'BASIC_LEXER')
PL/SQL procedure successfully completed.
SCOTT@10gXE> EXEC CTX_DDL.SET_ATTRIBUTE ('test_lex', 'WHITESPACE', ' -')
PL/SQL procedure successfully completed.
SCOTT@10gXE> CREATE INDEX test_idx ON test_tab (test_col)
  2  INDEXTYPE IS CTXSYS.CONTEXT
  3  PARAMETERS ('LEXER test_lex')
  4  /
Index created.
SCOTT@10gXE> SELECT token_text FROM dr$test_idx$i
  2  /
TOKEN_TEXT
1034
1034AMFM
95.1
AMFM
FM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034-AMFM') > 0
  2  /
no rows selected
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034\-AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034{-}AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '{1034-AMFM}') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034 AMFM') > 0
  2  /
TEST_COL
1034-AMFM
1034 AMFM
SCOTT@10gXE> SELECT * FROM test_tab WHERE CONTAINS (test_col, '1034AMFM') > 0
  2  /
TEST_COL
1034AMFM
SCOTT@10gXE>

Similar Messages

  • Special characters in search criteria

    Hi gurus.
    Can anyone tell me something about usage special characters in search cryteria (e.g. in transaction CN43N field POSID - I'm looking for some WBSs). I have try to find answer, but I'm not able to. I know about characters + and * , but I wonder are there any more. If yes, please tell me what do they mean
    Regards
    Michael

    Hi.
    Maybe my question makes no sense, but I did't know where to look for this information. I'm still looking for an answer, but close my question.
    Regards
    Michal
    Edited by: Michal Pluta on Apr 19, 2010 3:28 PM

  • The boxes where I would type in search terms and URL are GONE! So is the BACK BUTTON. HELP!

    I downloaded software to convert jpg files to pdf's, and it worked. however, I think it installed Incredimail, and I suspect that it installed Ask.com - neither of which I wanted. It was just after that that my back arrow and my boxes where i type in search terms and urls DISAPPEARED! Firefox is compatible with some important websites and has features that i need. NEED.

    Make sure that you do not run Firefox in Full Screen mode with all toolbars hidden.
    * Press F11 to toggle full screen mode (Firefox/File > Full Screen)
    If the menu bar is hidden then press the F10 key or hold down the Alt key, that should make the menu bar appear.
    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    * If items are missing then open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout" (Linux, Windows)
    * If a missing item is in the toolbar palette then drag it back from the Customize window on the toolbar
    * If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up.
    See also:
    * http://kb.mozillazine.org/Toolbar_customization
    * https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • Payment term and Baseline date are not appear after residual clearing

    Hi Friends,
    We have an issue in Payment term. Recently small changes were made in OBA3.Here they enable the option of "Payment term from invoice". the function of this is to - copy  the payment term and baseline date form invoice to Partial item .Due to enable of this function after residual clearing the payment term and base line fields are get empty.
    Now user want to get these fields to be updated even not changes take place in OBA3.Can you please suggest me the way,  with out changes in OBA3 can we get payment term and baseline date field after residual clearing .Please suggest .
    Thank you
    Regards,
    Dharma

    Hi Julie,
    Thanks for your reply..
    Here the issue is, the user using Baseline date for two specific purpose.
    1.Due day calculation-auditing purpose
    2.Agning report
    For due day calculation they recently enable the option "payment term from invoice in -OBA3".Due to active the function,system copy the payment term and baseline date from invoice to residual item.it means the residual item having baseline data as invoice date not posting date.
    But for aging report purpose it has to be update posting date.
    now user want to meet these both requirement .How can it possible .Please suggest.
    Thank you
    Regards
    Dharma

  • Payment terms and Baseline date deact. during posting

    Is it possible to deactivate fields: Payment terms and Baseline date in FB60 and MIRO so that the user can't change them? Terms of payment are defined in Vendor Master Data and shouldn't be changed during posting.

    Hi,
    You can use Screen Variants using T.Code  SHD0 . You can make certain field as display only. You can use the help of your abapers......
    Assign points if found useful
    Regards,
    R.Ramakrishnaraj

  • I went to import special characters in imovie '11 and now the character window comes up on every application, yet won't open in iMovie at all, it flashes across every screen on each key/mouse click

    I went to import special characters in imovie '11 and now the character window comes up on every application, yet won't open in iMovie at all, it flashes across every screen on each key/mouse click, stops the other software from running, and won't shut off, ever.

    Try trashing the .plist in Home/Library/Preferences which has CharacterPalette in its name.

  • Google search does not search after entering search term and pressing enter.

    When I type a search term into Google and then hit Enter, the page is inert. It does not go to search results. Or if I type a search term and select the Instant search suggested term and hit Enter, the search results page does not appear. If I go into Google settings and turn off Instant, then the Google Search works, but it is a waste of time to always have to turn off Google Instant. There is some conflict between Firefox and Google Instant because there is no problem using Google Instant in Internet Explorer.

    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Special Characters in the file name in Data Driven Subscription via File Share

    Hi,
    I am trying to create a Data Driven Subscription with option to delivery as  windows file share in SQL server 2005. I need to save the report as a pdf with the following file name  '[City] City_Name', but it errors out and it is because of the
    Square Brackets. Is there any way i can save the file using the Square brackets as i mentioned above.
    I am using a query to get the filename and filepath. It works fine as long as i do not have [], but i need to save the file as i mentioned along with the Square Brackets.
    Please help.

    Hello,
    I can reproduce the issue on my test environment: When I create a Data Driven Subscription and specify the report name by get from a subscription delivery table, and the value of the "report name" column contains square brackets. The subscription failed
    with following error in the error log:
    ERROR: Error occurred processing subscription ab9523a6-0256-4607-b818-a7666204d018:
    The file name is not valid. Avoid using special characters such as /\?*:<>|+,[]"& in the file name.
    notification!WindowsService_1!1f24!05/30/2014-15:31:02:: i INFO: Notification 0cf5a356-3172-4108-9d8c-58ea81a0b80a completed.  Success: False, Status: The file name is not valid. Avoid using special characters such as /\?*:<>|+,[]"& in the
    file name., DeliveryExtension: Report Server FileShare, Report: Report6, Attempt 0
    It seems that the behavior is by design. please avoid using square brackets as file name. Maybe you can try to use parentheses () instead.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Special Characters issue in DEV and QAS

    Hi,
    I am uploading a file that has special characters (Japanese).
    In the DEV system the special character is converted to #. Which the business wants.
    In QAS system the special character is not converted and is as it is, which makes the business users difficult to find out if any speical characters are there and they don't want the special character as it is
    The file consists millions of record with a possibility of four or five records with special characters
    The special characters on keyboards is not an issue.
    The programs in DEV and QAS system are same and the file tested is also the same but different results.
    Tried in Tcode SNLS to find something but didn't know what and where to look into.
    What could be the issue in this? Looks like this is Basis issue but would like to know if anyone can let me know.......
    Regards
    Sandeep

    Hi ,
    i want to check ur open dataset statement in the program which is being used here if at all in ur case.
    Can you please check the relavant code page in both the D and Q systems and search with the appropriate hexa decimal values(for the special characters ) in both the systems ..
    u can use code page by tcode scp ..
    ex -> as u say a special char sp1 is having entry in q and code page which is being used (like 4200 )
    is not having in d03 .
    then if in d03 this page has no entry then it shows as # , since it is showing in q then it has an entry over there. this is my guess..
    so if at all the client wants not to see this special char's , u need to remove them from this code page.. and check ..
    Cant say if this can solve but u can take this as one more way of dealing with code pages  and special chars....
    br vijay..

  • Special characters in java, oracle and html

    Hi,
    I'm working on a mini content management system and need help with dealing with special characters.
    The input are taken from html form which are then stored into a varchar column in oracle database.
    When i retrieve the data, some of the special characters have been changed to ??? and also
    fields with double quote are modified.
    I believe there two issues;
    1. dealing with special characters
    2. display special characters back in html form textfield after retrieving.
    e.g.
    This is the line with "quote" saved to database
    This is the line with "quote" retrieved from database
    This is the line with displayed in html text field.
    Any help will be much appreciated.
    Thanks in advance.

    Maybe you should try this couple of classes: java.net.URLDecoder and java.net.URLEncoder
    Andres
    Best

  • Use of special characters in Search String

    What is the use of special charaters like
    in the search string in the Find & Replace of ABAP editor ?
    I want to search for all strings starting with V which are followed by alphabets like
    VA
    VB...
    If I use V*, it also gives me results like
    V/R...
    Whether it is possible to specify such a condition?

    Hi,
    While giving ur search in FIND & REPLACE,
    use the match case or match whole word only..
    Then u will get search results only where the exact case of that variable is used..
    As per my knowledge there is no signification of special characters ,- : ; in the search string..
    Hope this helps...
    Cheers,
    Simha.

  • Payment terms and Due date field gets emptied after residual clearing

    Hi
    There is advance of Rs.50000 in Vendor ledger and Invoice of Rs.200000 (with payment term - G019)
    I cleared these two line items (residual clearing). One new line item got created of Rs.150000. When i saw that line item, i saw that there payment term field and due date field got emptied. My requirement is that the original payment term entered in initial invoice document (of Rs.200000) should automatically get populated in new line item of Rs.150000.
    How to fulfill this requirement?

    Thanks for the prompt reply.
    I wanted to ask one more thing. Same way when i do partial clearing (not residual), is it possible to populate the invoice's due date in advance line item. One link is that my invoice reference gets populated advance line item. So i want due date (not payment term) also to get populated in advance line item.
    Please help.
    Edited by: Deepak Agrawal on Jul 29, 2011 11:43 AM

  • Question about Payment term and due date

    Hi experts,
         I encouter a question about payment term:
    I have the payment term ,the baseline date,document date and posting date.How can I get the due date??Is any SAP function module can calculate the due date?
    Thanks a lot in advance.
    Villy.Lv.

    Hi guys,
       we can use this FM FI_TERMS_OF_PAYMENT_PROPOSE to get the Days for net due date and add it to base line date,then we get the due date.
    BR and thanks a lot.
    Villy.Lv.

  • Special characters in file names and directories

    I'm building a site that lets users create directories to
    which they give the name they want.
    Using PHP, is there one universal solution to avoid any
    special characters in directories, yet will
    display the directory/file names in html the way the user
    intended?
    example of a possible name:
    "ça alors: it's a déjà-vu"
    How can I encode this so it's valid as a directory name, yet
    can be displayed as intended when the
    name is output to the page. urlencode() does not do the job,
    neither does htmlentities()...
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

    (_seb_) wrote:
    > Gary White wrote:
    >> On Sun, 19 Nov 2006 19:15:04 +0100, "(_seb_)"
    <[email protected]> wrote:
    >>
    >>> "ça alors: it's a déjà-vu"
    >>>
    >>> How can I encode this so it's valid as a
    directory name, yet can be
    >>> displayed as intended when the name is output to
    the page.
    >>> urlencode() does not do the job, neither does
    htmlentities()...
    >>
    >>
    >> What's wrong with:
    >>
    >> $l="ça alors: it's a déjà-vu";
    >> print urlencode($l)."<br>\n";
    >> print htmlspecialchars($l);
    >>
    >> Gary
    >
    >
    > I know that, but what is the name of the directory? It
    has to be a real
    > directory name, not a string stored somewhere.
    >
    > What's a valid encoding for a directory named "ça
    alors: it's a
    > déjà-vu"? I can call a folder like this on my
    Mac, but it won't work on
    > any server...
    >
    >
    >
    PS: basically it's not a url encoding issue.
    I can url encode "ça alors: it's a déjà-vu",
    and pass it in a url query string. But my issue is not
    with an url query string, it's with an actual URL, that is,
    the actual name of the directory. It
    can't be "ça alors: it's a déjà-vu". But I
    want to allow the user to name their directory like that
    if they want. So I need a way to encode this into characters
    that can be used for an actual
    directory on the server.
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • Enabling Spotlight Web Search - Multiple Search Terms and Boolean Searches

    Hello there,
    I'm trying to incorporate a spotlight web search into my website as per these articles:
    http://docs.info.apple.com/article.html?path=ServerAdmin/10.5/en/c3ws21.html
    http://support.apple.com/kb/TA23537?viewlocale=en_US
    What I'm finding is that the search page provided by using template.spotlight file does not give search results when more that one search term is entered. Additionally, boolean terms (AND, OR, NOT) do not appear to work.
    I've tried to edit the template.spotlight file but I'm not sure what to add in order to provide this functionality which is otherwise present in spotlight searches within Mac OS. Has anyone else used the spotlight web search feature for their websites and had success with multiple search terms / boolean searches? Could someone please advise on how to edit template.spotlight to provide these search features?
    Thanks in advance,
    Leon G

    (bump)

Maybe you are looking for