Proximity Search Text

Hi,
I need help in Proximity search in Oracle Text.
For example, below query gives all records that contains "Finance" and "Econony" within 10 words...
     SELECT col1_id, col2_text
     FROM table1
     WHERE CONTAINS (col2_text, 'NEAR ((finance, economy), 10)') > 0;
I want to display 10 words before and 10 words after "finance/econony" words for each and every occurrance in all the records returned by above query.
Can you please let me know how to achieve this. I am working on Oracle Database 11g Enterprise Edition Release 11.1.0.7.0.
Thanks a lot in advance.

Hi,
if this could be solved with oracle text it is somewhat specific, so perhaps it is advisable to ask this in the oracle text forum.
Amongst others there is fabulous Barbara Böhmer supporting:
ctx_doc.snippet increase the number of occurrences returned
I tried this below, but i didnt figure out what range of the document snippet returns. It seems not to be configurable anyway
select
empno
,rowid
,ename
,ename2
,ctx_doc.snippet('E_NAME_CTX', to_char(empno), 'NEAR ((KING,G),2)',' ',' ') snippet
from e
where
contains (ename2, 'NEAR ((KING,G),4)') > 0
EMPNO     ROWID     ENAME     ENAME2     SNIPPET
7839     AA6tnqAJIAAAAGWAAA     KING     agfaffaffuhufihasf A B C D E KING F G H I J hsfhauifhsafhsuf     agfaffaffuhufihasf A B C D E KING F G H I J hsfhauifhsafhsufregards

Similar Messages

  • Unable to create web app items if Proximity Search is Enabled.

    I am using BC API to create web app items because I am getting the data from a third party website and wanted to save the data into web app by using BC API. I have a web app ( Name: "Map Overview" ) and the proximity search is enabled. When I test my script I got 404 bad request error but if I disabled the Proximity Search the item is created.
    Can someone help me on this?
    Thanks

    Let me know the page you are running the API call on, I'll have a look and see what gives.
    Thanks,
    Mihai

  • Search text in sql server 2000

    how can i preapre a script to search all stored procedure, view, etc. which contain search text. just list out all the sp name, view name.

    select distinct
    object_name([id]) as obj_name,
    case
    when objectproperty([id], 'IsProcedure') = 1 then 'stored procedure'
    when objectproperty([id], 'IsScalarFunction') = 1 then 'scalar function'
    when objectproperty([id], 'IsTableFunction') = 1 then 'table function'
    when objectproperty([id], 'IsView') = 1 then 'view'
    end as obj_type
    from
    syscomments
    where
    objectproperty([id], 'IsProcedure') = 1
    or objectproperty([id], 'IsScalarFunction') = 1
    or objectproperty([id], 'IsTableFunction') = 1
    or objectproperty([id], 'IsView') = 1
    and objectproperty([id], 'IsMSShipped') = 0
    and [text] like '%orderid%'
    order by
    obj_type, obj_name
    go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How search text in current frame of external swf?

    Hello Everyone
    I am loading an external swf using loader.
    How do search and highlight the text in the current frame only?
    Is there a frame class which I could use?
    Thanks

    This is not likely to be possible in the general case, depending on what you mean by "searching text"
    For instance, a Word doc might have the text "Hello, world!" when viewed in Word, but that doesn't mean that the sequence of characters 'H', 'e', 'l', 'l', 'o', etc., exists in the file. There might be one letter, then some binary data indicating that the next letter is some other font or color, then one more letter, then more binary data, etc.
    Conversely, there could be textual metadata in a "binary" file that a person reading the file in the appropriate viewer would never see. Unless you know the details of the format you're reading, you won't be able to distinguish that from "real text".
    And what do you mean "strings" is not efficient? Have you tried it? Does it do what you want? Did you measure and determine that it does not meet your well-defined performance requirements? It's unlikely you'll be able to write code that does the same thing as "strings" but more "efficiently."
    The first step is to put more realistic boundaries on your requirements and define them more precisely. "Extract text from any binary file," is not a valid, meaningful, or reasonable requirement.
    EDIT: I may have misunderstood your requirements. I thought you wanted to "extract all text" from binary files. If that's not what you meant, and you're looking more to replicate grep, then follow Joachim's advice.
    Edited by: jverd on Mar 29, 2010 1:33 PM

  • How to select and search text in this document?

    http://www.oracle.com/technology/products/manageability/database/pdf/ow05/PS_S003_274003_1 06-1_FIN_v2.pdf
    is a document I can read but cannot copy text from. I can't search for any text in it either. Is there a way to convert it to a PDF file I can select and search text in? What did the author do to make it "encrypted"? Thanks.
    Yong Huang

    I notice Google can convert it to plain text:
    http://74.125.95.132/search?q=cache:e4rkLs8pPekJ:www.oracle.com/technology/products/manage ability/database/pdf/ow05/PS_S003_274003_106-1_FIN_v2.pdf+understanding+shared+pool&cd=1&h l=en&ct=clnk&gl=us
    (If that long URL doesn't work, just search for "understanding shared pool" and click "View as HTML".)
    For now I'll use that. Thanks everyone.
    Also, my local desktop search program Copernic can also index keywords in the article.

  • Find caret position of search text in jEditorPane

    Hi All,
    I am looking for a way to find the Caret position in a jeditor pane for the search text that i supply. The Jeditor pain is setup for text/html and when i find the index of my search text "ANCHOR_d" in the jeditor pane is 27000 something but the caret position is 7495 how do you find the caret position of the search text ??
    Any help is appriciated.
    I am also looking into getting abnchoring to work in the jeditorpane html text but as of yet i have been unsuccessful.
    Kind Regards,
    Wurns

    Search the underlying document, not the editor pane. Play around with this example, which I threw together the other day for a somewhat similar problem with JTextPane involving newlines, and modified for your need.
    Note: Please do not program by exception.import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JButton;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    import javax.swing.text.Document;
    public class SearchEditorPane {
       JFrame frame = new JFrame ("Search JTextPane Test");
       String html = "<HTML><BODY><P>This is <B>some</B>" +
                    " <I>formatted</I>" +
                    " <FONT color=#ff0000>colored</FONT>" +
                    " html.</P>" +
                    "<P>This is a <FONT face=Comic Sans MS>" +
                    "comic <br>\n<br>\nsans ms</FONT> section</P><div>" +
                    "And this is a new division</div>" +
                    "</BODY></HTML>";
       JEditorPane editorPane = new JEditorPane ("text/html", html);
       JPanel panel = new JPanel ();
       JTextField textField = new JTextField (10);
       JButton button = new JButton ("Find");
       Document doc = editorPane.getDocument ();
       void makeUI () {
          editorPane.setText ("<HTML><BODY><P>This is <B>some</B>" +
                " <I>formatted</I>" +
                " <FONT color=#ff0000>colored</FONT>" +
                " html.</P>" +
                "<P>This is a <FONT face=Comic Sans MS>" +
                "comic <br>\n<br>\nsans ms</FONT> section</P><div>" +
                "And this is a new division</div>" +
                "</BODY></HTML>");
          button.addActionListener (new ActionListener () {
             public void actionPerformed (ActionEvent e) {
                // Programming by exception is BAD, don't copy this style
                // This is just to illustrate the solution to the problem at hand
                // (Sorry, uncle-alice, haven't reworked it yet)
                try {
                   Matcher matcher = Pattern.compile (textField.getText ())
                   .matcher (doc.getText (0, doc.getLength ()));
                   matcher.find ();
                   editorPane.setCaretPosition (matcher.start ());
                   editorPane.moveCaretPosition (matcher.end ());
                   editorPane.requestFocus ();
                } catch (Exception ex) {
                   JOptionPane.showMessageDialog (frame, "Not Found!\n" + ex.toString ());
                   //ex.printStackTrace();
          panel.add (textField);
          panel.add (button);
          panel.setPreferredSize (new Dimension (300, 40));
          frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
          frame.setSize (300, 300);
          frame.add (editorPane, BorderLayout.CENTER);
          frame.add (panel, BorderLayout.SOUTH);
          frame.setLocationRelativeTo (null);
          frame.setVisible (true);
       public static void main (String[] args) {
          SwingUtilities.invokeLater (new Runnable () {
             public void run () {
                new SearchEditorPane ().makeUI ();
    }db

  • Search text in PDF and MS Word document

    Can any body tell me how search text in PDF and MS Word document through Java code, any body has code or any suggestion to give
    Thank You
    Adnan

    Can any body tell me how search text in PDF
    and MS Word document through Java code, any
    body has code or any suggestion to giveYes.
    First, you need to work out how to read each document type from Java.
    E.g, for MS Word you could use Apache Jakarta POI - HWPF: http://jakarta.apache.org/poi/hwpf/index.html
    Then, you use Apache Lucene to index and search.
    See http://lucene.apache.org/java/docs/index.html
    ~D

  • How to change the width of textbox in Search Texts iview

    Hi, Experts,
         I creat a search texts iview with stardard configuration to search the data in the repository.
    The problem is that the width of textbox is too short. And the user will input more than 40 characters in the textbox.
       In this way, the users can't see all the information unless he put the mouse pointer in the textbox and drag it.
       Is there any stardard configuration in MDM or MDM Portal to increase the width of textbox?
      Regards,
      Youli

    Hi Youli,
    I tried this but seems like there is no property available to change this setting. As these iViews are standard shipped, we cannot modify the design or code.
    Regards,
    Jitesh Talreja

  • Trying to use Oracle Locator for latitude and longitude proximity searches

    I am prototyping using Oracle Locator to do proximity searches and other spatial operations within the database in our software products. I’ve got it working fine in SQL Server, where geodetic is built in as well as geometric features, but with Oracle we’re trying to restrict ourselves to the Locator features so our customers are forced to buy the add-on. I am getting perplexing results, as you can see if you run the little test program I wrote.
    I am using lat and long as the point coordinates. I am inserting the data using
    SDO_GEOMETRY(2001, 4326, SDO_POINT_TYPE(?, ?, null), null, null
    Then I am doing the search with
    SELECT pointname, SDO_NN_DISTANCE (1) distance_in_miles
    FROM geotest g
    WHERE SDO_NN(g.geopoint, sdo_geometry(2001, 4326, SDO_POINT_TYPE(38.683, 123.083, NULL), NULL, NULL), 'distance=1000 unit=mile', 1) = 'TRUE'
    ORDER BY distance_in_miles
    I am getting distances from 56 to 86 units, whatever the units are.
    Am I attempting the impossible with Locator, to use lat and long and then expect the sdo_nn function to work in miles?
    Select results:
    POINTNAME DISTANCE_IN_MILES
    Point number 19 56.8497254738894
    Point number 17 57.0758802885512
    Point number 5 62.096857977487
    Point number 3 67.3555572959989
    Point number 16 70.8005407529483
    Point number 1 73.0370426667902
    Point number 9 73.1047740624495
    Point number 14 73.1451566004902
    Point number 11 74.9344307572887
    Point number 10 75.3710529989389
    Point number 2 75.423714095366
    Point number 8 77.2121183101138
    Point number 4 77.6458963754559
    Point number 18 80.4569749046142
    Point number 6 81.0025026191188
    Point number 20 81.8444977200089
    Point number 13 83.4095236051998
    Point number 15 86.9333533902019
    Point number 7 88.9312783958262
    Point number 12 98.72957787982
    Point number 0 98.9999489634554
    21 rows selected

    Couple of things that we found out using sdo_nn here...
    It works...but the knobs need to be turned in the right order...
    You may have done this already...but here is what we have...
    a. we create our table containing the location sdo_geometry column ..( in our case the column is called location )
    b.We loaded the data..If you elected to use a partitioned table for your spatial data and created the corresponding spatial index as local...your sql will need to account for that.if your index is global ..don't worry about it
    c. We inserted the metadata...this needs to be done once per table...by either the dba or the schema owner...
    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
    VALUES ('<YOUR TABLE NAME>', '<SPATIAL COLUMN NAME>',
    MDSYS.SDO_DIM_ARRAY
    (MDSYS.SDO_DIM_ELEMENT('LONGITUDE', -180.0, 180.0, 0.5),
    MDSYS.SDO_DIM_ELEMENT('LATITUDE', -90.0, 90.0, 0.5)
    8307);
    COMMIT;
    If this is not done before the spatial index is created...stuff won't work...
    d. create your spatial index
    e. our query looked something like this...( I changed the table names )
    This returns the top 30 results sorted by distance in feet...
    SELECT LOCATION_KEY,
    result_center_distance
    FROM
    SELECT LOCATION_KEY,
    SDO_NN_DISTANCE(1) result_center_distance
    FROM LOCATION_OWNER.D_LOCATION dlocation
    WHERE SDO_NN(dlocation.LOCATION,
    MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(-97.07845,33.138006,null),null,null), 'SDO_NUM_RES=31 unit=FOOT distance=5800.0 SDO_MAX_MEMORY=50000000', 1) = 'TRUE'
    ORDER BY 2
    WHERE ROWNUM <= 31
    We had to use this structure because our index is local...and sdo_nn will return the sdo_num_res results for each partition...so you need to get the results first..then treat it as a top-n query...
    If you index is global...this should work
    SELECT LOCATION_KEY,
    SDO_NN_DISTANCE(1) result_center_distance
    FROM LOCATION_OWNER.D_LOCATION dlocation
    WHERE SDO_NN(dlocation.LOCATION,
    MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(-97.07845,33.138006,null),null,null), 'SDO_NUM_RES=31 unit=FOOT distance=5800.0 SDO_MAX_MEMORY=50000000', 1) = 'TRUE'
    ORDER BY 2
    If you want the distance in MILE...replace FOOT by MILE...
    good luck...
    Edited by: user5431290 on Oct 23, 2011 9:36 AM

  • Can't include a reset button/process that cleans a search text field

    Hi all
    Using apex 3.0.1 on a XE edition
    In my app there's a report that displays a lot of records.
    I included an text field item, where user can type a search criteria, then i added a button called "search" which, when submitted, display the records where search criteria is included.
    Now, my problem is that i can't put a "reset" button, which, when submmitted, is supposed to clear the search text field, so the report display all records.
    I tried adding a branch that triggers when reset buttos is pressed, clearing cache of search text field. It didn't worked, search string keeps on showing on text field.
    Then i changed the process, instead of clearing cache, setting search text field item with a value of null. Didnt work either...
    Does anyone have a good example of thjis type of reset button???
    tnks in advance....
    Fernando

    yes Earl, i know it's pretty standard...but i got some trouble... anyway, i think it was just a "lapsus brutus" o' mine... It's solved now and here's what i did:
    I created a text field button (where search string will be typed), a "submit as Go" button, and a "submit as reset" button. Then i created an uncondicional branch to same page, then i created a Clear Cache for Item process, where the text field cache is cleared, conditioned when "submit as reset" button is pressed.
    That solved the problem, thnx very much for your help
    fernando

  • Searching text in PDF

    I believe that I have heard that in GW 8 it will be possible to search text in PDF documents.
    I have tried it, but it doesn't work.
    Is there a way to make it work in GW 8?
    Thanks,
    Tomislav

    Dave Parkes wrote:
    > I don't know enough about the Linux setup to know precisely what is called
    > on that OS.
    It's still called the document conversation agent on Linux. I would set off
    an indexing run to see if it kicks it all off properly. My PDFs have been
    indexing here for a good long time :)
    Danita
    Time to upgrade to GW8!
    http://www.caledonia.net/gw8upg.html

  • Using Underscore In OIDDAS Group Search Text Box

    Hi Everyone,
    I am using the 'Directory' tab within the Oracle Self Service Console to search for user Groups.
    Most of my groups are of the form : PORT_xx_xxxx
    I am trying to search for all groups beginning PORT_ but if I enter that as a search query the underscore is treated as a single character wildcard. In my case this means the search results display PORT_xx_xxxx groups as well as a load of PORTAL_xxxx groups
    Is there a way to escape the underscore so that it is treated as a character and not a wildcard?
    If this was SQL then there is plenty of info out there about escaping underscores but nothing in relation to normal search text boxes.
    Matt

    Hi Luis,
    I tried PORT\_ but it still returns PORT_xx and PORTAL_xx results.
    I've got a feeling the text box filters out the usual escape characters making escaping the underscore impossible. It a bit annoying because it isn't as if the underscore is an unusual character to have in a group name!
    Matt

  • MDM search text iView --when searchnode it should displayall parents&childs

    Hi all
    I have create one page & added three iViews to that page. one is MDM search text iView second is resultset iView & third is Itemdetails iView.
    actually my requirement is when i search for any node in the search text iView then it has to display all the parents & child nodes of that search node. for example when i search for node india it has to all parent & all child nodes of the node "India".
    now i am able to get all the parent nodes of node "India" in the resultset iView but i am not getting the child nodes of india like karnataka,tamilnadu etc.
    now i want to display all the parents & all child nodes of the search node "India".
    Please help me on this ASAP.
    Regards
    Sunil

    Hi Sunil,
    This is the default behaviour which cant be changed. I tried this thing and I observed that if child node contains the search pattern then only it will display the entire path from root node till the child that contains the search text because it starts traversing from the top and moves till the leaf.
    If your tree is some what looks like this then only it is possible to achieve the expected behaviour.
    India
       Tamilnadu:India
       Chennai:India
    But I can understand this is not feasible. Lets wait for some replies regarding this.
    Regards,
    Jitesh Talreja

  • Search text files in a folder

    Im given a project to implement a text file search engine to search text files in a folder to find matches for a given text and display the path of containing files. Here have to implement all the data structures i use.In order to search matches for given text , first i have to separate txt files and subfolders in a given folder. But i cant think of a way to separate them. does anybody have a solution?
    Thanx!

    Can you try something like this? This lists all the directories and their sub-directories along with the files. Displays the files with paths too.
    public class FileSearch {
         private static final String PATH = "C:\\temp";
              public static void main(String[] args){
                   File file = null;
                   String[] contents = null;               
                   file = new File(PATH);
                   contents = file.list();
                   for(String fileDir : contents){
                        file = new File(PATH+"\\"+fileDir);
                        if(file.isDirectory()){
                             System.out.println("["+file+"]");
                             listDirectory(file);
                        else{
                             System.out.println("     "+file);
              public static void listDirectory(File theFile){
                   String[] dirContents = null;
                   String path = theFile.getAbsolutePath();
                   if(theFile.isDirectory()){
                        dirContents = theFile.list();
                        for(String newFile : dirContents){
                             File dirFile = null;
                             dirFile = new File(path+"\\"+newFile);
                             if(dirFile.isDirectory()){
                                  System.out.println("["+dirFile+"]");
                                  listDirectory(dirFile.getAbsoluteFile());
                             else{
                                  System.out.println("     "+dirFile);
                   else{
                        System.out.println("     "+theFile);
         }

  • Trex is not searching texts in any document types other then PDF.

    Dear All
    We are implementing DMS in ECC 6.0.We have configured Trex 7.0 text search in ABAP stack. Trex not searching text in .dwg (Autocad) *.doc (Word files) files in SAP System through CV04N T-code it is not searching.
    It is searching only pdf files.
    System Details:
    Server ECC 6.0
    SAP_BASIS - SAPKB70010
    SAP_ABA - SAPKA70010
    SAP_APPL - SAPKH60007
    EA-APPL - SAPKGPAD07
    Error Message:
    We have added the mime types for full text search in SAP System, SPRO &#61664; Cross-Application Components &#61664; Document Management &#61664; General Data &#61664; Settings for Storage Systems &#61664; Maintain Storage System as application/acad & application/doc. And also in Trex server usr\sap\<SID>\TRX00\Trex\TREXValidMimeTypes.ini file.
    After adding we have restarted the Trex server & done the Reindexing in SAP System & tried. But it is not searching the text in autocad files.
    Kindly support for us, to solve this issue.
    Regards
    Harshavardhan.G
    Mob: - 91 99130 88039

    Hi Harshavardhan,
    could you please create a OSS ticket for BC-TRX and attach an example of DWG document to this. Please also check if the includehidden parameter (TREXFilter.ini) is set to true.
    Best regards,
    Mikhail

Maybe you are looking for

  • Synchronizing local database and server database

    Hi, I am working on an application where users store information on their laptops in a local database. Once a day, synchronizing has to take place with the server database. The clients will send their mutated data to the server and the server will se

  • CSAP_BOM_ITEM_MAINTAIN - Problems while clearing custom fields

    Hi, I try to modify some bom items, it works fine so far, but I get into trouble when trying to update previosly filled fields with empty ones. First, I check my structure and insert a 'delete field character' into initial fields: LOOP AT fieldcat IN

  • Camera light problem

    Camera light on stock app on Lumia 720 does not work, it didn't before and after 8.1 update. But on nokia camera app it does work fine, i think it is a bug. I just could use nokia camera but i like stock camera app more its just faster on this mid ra

  • 10.8 and 10.6 on different partitions?

    I have a new mini. It came with 10.8 installed. First, I made two partitions, then reinstalled 10.8 and updated to 10.8.1. So far, so good. Now I want to put 10.6 on the other partition and migrate to there to ease my OS transition. The mini won't le

  • Meeting Place Questions

    Please help me with the following questions with MP 7. We are planning to implement MP 7 in our network soon. /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style