Searching for content in stored webpages?

I am a student and Oracle Text is new to me. I am using isqlPlus with Oracle10g
I am trying to search the content of external websites I upload using a procedure. The files are uploaded as BLOBs. I know UltraSearch is out there, but I´m trying to make an easy example using only SQL syntax. So far, I am able to load the html documents into a directory, but the search results are always 0. I don´t know what I am missing (sorry for the ignorance)! Can anyone give me some tips?
I am not a DBA. This are the rights I have:
CONNECT
CREATE SESSION
CREATE ANY DIRECTORY
CTXAPP
RESOURCE
CREATE CLUSTER
CREATE INDEXTYPE
CREATE OPERATOR
CREATE PROCEDURE
CREATE SEQUENCE
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
UNLIMITED TABLESPACE
--First I create a table
DROP TABLE t03_sorbaugh.CONTENT_INVENTORY;
CREATE TABLE t03_sorbaugh.CONTENT_INVENTORY (
CONTENT_INVENTORY_ID NUMBER NOT NULL,
FILE_NAME VARCHAR2(1024),
KEYWORDS VARCHAR2(2048),
URL SYS.HTTPURITYPE,
TEXT BLOB DEFAULT empty_blob(),
TEXT_LOADED CHAR(1) DEFAULT 'N' NOT NULL,
CONSTRAINT UNQ_CONTENT_INVENTORY
UNIQUE(CONTENT_INVENTORY_ID) USING INDEX
TABLESPACE USERS
--Then I load an external Website
INSERT INTO t03_sorbaugh.CONTENT_INVENTORY
(CONTENT_INVENTORY_ID, URL, KEYWORDS)
VALUES ('1', sys.httpuritype.createuri('http://en.wikipedia.org/wiki/Art'), '');
COMMIT;
--The Procedure looks like this (sorry for not keeping it short)
CREATE OR REPLACE PROCEDURE loadLOBFromBFILE IS
Dest_loc BLOB;
Src_loc BFILE := BFILENAME('DIR_TESTCASE', '');
Amount INTEGER := 0;
cursor ContentInv_cursor is
--create a recordset of the file names
--that we need to load from the filesystem into the
--Oracle database.
SELECT
CONTENT_INVENTORY_ID,
FILE_NAME
FROM t03_sorbaugh.CONTENT_INVENTORY
WHERE FILE_NAME IS NOT NULL;
varContentInv_id CONTENT_INVENTORY.CONTENT_INVENTORY_ID%TYPE;
varFileName CONTENT_INVENTORY.FILE_NAME%TYPE;
BEGIN
open ContentInv_cursor;
loop
varFileName := NULL;
varContentInv_id := NULL;
fetch ContentInv_cursor into varContentInv_id, varFileName;
exit when ContentInv_cursor%notfound;
Src_loc := BFILENAME('DIR_TESTCASE', varFileName);
IF DBMS_LOB.FILEEXISTS (Src_loc) = 1 THEN
SELECT text INTO Dest_loc FROM CONTENT_INVENTORY
WHERE CONTENT_INVENTORY_ID = varContentInv_id FOR UPDATE;
/* Opening the LOB is mandatory */
DBMS_LOB.OPEN(Src_loc, DBMS_LOB.LOB_READONLY);
DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, dbms_lob.getlength(Src_loc));
/* Closing the LOB is mandatory */
DBMS_LOB.CLOSE(Src_loc);
/* Optional update statement */
UPDATE t03_sorbaugh.CONTENT_INVENTORY
SET TEXT_LOADED = 'Y'
WHERE CONTENT_INVENTORY_ID = varContentInv_id;
COMMIT;
END IF;
end loop;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20001, 'Error occurred while loading LOBs.');
close ContentInv_cursor;
END;
-- I upload the file to the directory 'd:\daten\oracletextpraktikum'
set serveroutput on;
EXECUTE loadLOBFromBFILE;
-- PL/SQL-Prozedur erfolgreich abgeschlossen.
-- Now the preferences and the index
begin
ctx_ddl.create_preference('doc_lexer', 'BASIC_LEXER');
ctx_ddl.set_attribute('doc_lexer', 'printjoins', '_-');
end;
drop index idxContentMgmtURL;
create index idxContentMgmtURL on content_inventory(url) indextype is ctxsys.context;
-- Finally, I run an example where I search for the word "Art" ... the only Webpage uploaded to my directory contains the Art definition from Wikipedia, but still, I get no search results :(
SET LINESIZE 5000
SET PAGESIZE 5000
select content_inventory_id, url
from t03_sorbaugh.content_inventory
where contains(url,'&WORD_TO_FIND') > 0;
--Type "Art"
neu 3: where contains(url,'art') > 0
Es wurden keine Zeilen ausgewählt
Is isqlPlus somehow limited in using Oracle Text? I can´t seem to find the Problem!

Okay, but I'm afarid I can't help much more than that, as I'm still new at Oracle Text myself. From my limited knowledge, it all looks fine, but like you, I must be missing something.
You might try asking the DBA if the TXTSUP_UTIL package is installed in the CTXSYS schema. If it isn't, he can download it from Metalink or I can send it via email.
While it won't fix the problem, it does offer some insight into the index preferences and storage, etc.
BIll Ferguson

Similar Messages

  • Search for content within a PDF

    Is it possible to search for content within a PDF across a mapped drive?

    Yes. Use Edit>Advanced search. Choose All PDF Documents in and choose the mapped drive.
    They have to be searchable PDF's of course...

  • How do I search for text on a webpage?

    I have found some answers for mobile devices, but how do I search for text on a webpage for my notebook?

    You will find command F is fairly universal.
    good computing

  • Will TREX/KM search for content on PDF files in Searchable image formats?

    Good Day,
    We are implementing KM/Trex for an SAP E-sourcing installation and I'm wondering if TREX is able to search PDF contents in the Searchable image format?
    Essentially, we scan a document which creates an image and then run Abobe Acrobats OCR on the document to create searchable text.
    Thanks in Advance,
    Kyle

    Hi Kyle,
    TREX is not able to index a scanned document even this is pdf.
    BUT if afterwards a OCR is running and this OCR text will be stored as hidden text in the pdf than TREX is able to search in this pdf.
    Best regards
    Frank

  • How do I search for content in my bookmarks?

    Hello,
    is there a way to search only my bookmarks for content?
    Essentially turn my bookmark folder into a personalized google?
    Thanks

    Click the Bookmarks icon left side of the Safari window then select a Bookmark folder.
    You should see a search field with a magnifying glass icon top right.

  • Searching for content in text insets

    In a FrameMaker book, is there a way to search all the text insets in a book without opening each individual inset?
    I'm working on a project that has more than 30 text insets. I'd like to search for certain terms without having to open each inset. I'm using FrameMaker 11.

    Not really, as FM won't search the inset content directly. You could try creating an auxiliary book that contains just the inset files and use the Find function on that book. You can also add this book to your main book and mark it with Exclude so it doesn't get output, but still provides access to everything from the main book file.

  • Is there a way to globally search for content?

    As more types of video become available, my biggest bugaboo with the Apple TV is the lack of a global search for a movie or TV show title or actor. I now look on Netflix, then look on Hulu, then look at YouTube, then look in iTunes store every time I have an idea for something I wish to watch enters my head.
    Other than a jailbreak, is there some way to do this that I am not getting? Is anyone else interested in this feature? Friends running home servers like Plex always bring this up as one of the reasons to use their solution.

    Jailbreaking will not help you with that. It is a matter of what vendors are dealing wheat suppliers, they aggrements they have in place, and the content they can get, and where (geographically) they can provide it.  Other than iTunes, Apple has no control over that (and limited control even then).
    I've been using an app called CanIStream.It for a while. Not always 100% accuratre, but has helped to find some content. I think they have a corresponding website, but not sure.

  • SAP Forums (Jive) and TREX 7.1 search for content in attachements

    Hi
    I'm trying to find out if and how its possible to set TREX 7.1 up to index content and attachments in Jive forums. I've found a statement saying that portal search dosent work for Forums (EP-COL-APP-FOR).
    Does anybody know if this can be done and then how ?
    Of course I need a search UI for Forums if the standard one dosent work..
    We are talking EP7.0 with Forums 7.00 sp 18.
    Brgds Henrik

    Hi Herik,
    you can configure TREX to index the forum repository manager and by that search forums, categories, threads and messages.
    Have a look at this link for more information:
    http://help.sap.com/saphelp_nw70/helpdata/EN/47/17904a21fa3696e10000000a11466f/frameset.htm
    Hope this helps,
    Robert

  • Searching for content within a specified directory

    I am trying to do a simple content search on a specified directory, but I do not get the results I expect.
    I have looked at the examples and based my code upon them.
    If anyone can spot what I am missing or have forgotten I would be very grateful.
    Thanks
    Chris

    Here is the offending code :import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.LibraryService;
    import oracle.ifs.adk.filesystem.*;
    import oracle.ifs.beans.Search;
    import oracle.ifs.search.AttributeQualification;
    import oracle.ifs.search.AttributeSearchSpecification;
    import oracle.ifs.search.ContextQualification;
    import oracle.ifs.search.ContextSearchSpecification;
    import oracle.ifs.search.FolderRestrictQualification;
    import oracle.ifs.search.JoinQualification;
    import oracle.ifs.search.SearchClassSpecification;
    import oracle.ifs.search.SearchClause;
    import oracle.ifs.search.SearchQualification;
    import oracle.ifs.search.SearchSpecification;
    import oracle.ifs.search.SearchSortSpecification;
    // Import objects for working with search results
    import oracle.ifs.beans.LibraryObject;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Folder;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.ContentObject;
    import oracle.ifs.beans.SearchResultObject;
    // Import object for exception handling
    import oracle.ifs.common.IfsException;
    import oracle.ifs.common.AttributeValue;
    import java.util.Vector;
    public class contentSearch
    LibrarySession ls;
    String strSearch;
    public contentSearch()
    public void setSession( LibrarySession libsession )
    ls = libsession;
    public LibrarySession getSession()
    return ls;
    public void setSearchString(String str)
    strSearch = str;
    public PublicObject[] SearchSimple()
    Vector vecOutput = new Vector(50,5); PublicObject[] resultsArray = null;
    try
    ContextQualification cq = new ContextQualification();
    cq.setQuery(strSearch);
    String ContextClauseName = "CQ";
    cq.setName(ContextClauseName);
    SearchSortSpecification sortSpec = new SearchSortSpecification();
    sortSpec.add(Document.CLASS_NAME, ContextQualification.ORDER_PREFIX+"."+ContextClauseName, true);
    JoinQualification jq = new JoinQualification();
    jq.setLeftAttribute(Document.CLASS_NAME, Document.CONTENTOBJECT_ATTRIBUTE);
    jq.setRightAttribute(ContentObject.CLASS_NAME, null);
    // Add Folder Restriction for the search
    IfsFileSystem fsAPI = new IfsFileSystem( ls );
    PublicObject po = fsAPI.findPublicObjectByPath("public_demo");
    FolderRestrictQualification frq = new FolderRestrictQualification();
    frq.setStartFolder( (Folder) po);
    frq.setSearchClassname(PublicObject.CLASS_NAME);
    // END of FolderRestrictionQualification
    SearchClause sc = new SearchClause( cq, jq, SearchClause.AND );
    ContextSearchSpecification cp = new ContextSearchSpecification();
    cp.setContextClassname("CONTENTOBJECT");
    cp.setSearchClassSpecification(new SearchClassSpecification(new String[] {"DOCUMENT", "CONTENTOBJECT"}));
    cp.setSearchQualification(sc);
    cp.setSearchSortSpecification(sortSpec);
    // Session connection
    LibrarySession session;
    LibraryService serv;
    // Connect to Oracle iFS
    serv = new LibraryService();
    session = serv.connect("system", "manager", "IfsDefault");
    Search s = new Search(session, cp);
    try
    LibraryObject lo;
    // Open the search
    s.open();
    while (true)
    // Returns the next result row into Library Object
    lo = s.next().getLibraryObject();
    // Add LibraryObject to output vector to return
    vecOutput.addElement( lo );
    if (lo == null)
    throw new RuntimeException ("Retrieving search results : LibraryObject is null");
    else
    // Print results
    System.out.println(lo.getName());
    } // End Of While Loop
    } // End Of try block for search open
    catch (IfsException e)
    /* Throw an error, unless the exception is
    * 22000 'End of Data' which is always thrown
    * when s.next() reaches the end of the cursor.
    if (e.getErrorCode() != 22000 )
    // Something bad happened
    e.setVerboseMessage(true);
    throw new RuntimeException("Error happened in returning result set:"+e.getMessage());
    } // End of catch block for search open
    finally
    // Check if the size of ResultSet Vector Is more than zero
    if ( vecOutput.size() > 0)
    resultsArray = new Pub licObject[vecOutput.size()];
    for (int i=0; i < vecOutput.size(); i++)
    // Copy the result set library object to Public Object Array
    resultsArray[i] = (PublicObject) vecOutput.elementAt(i);
    } // End IF
    // Close the search
    s.close();
    } // End of Finally block for search open
    catch (IfsException i)
    System.out.println(" " + i.getMessage());
    return resultsArray; // Return the results
    null

  • When users are trying to search for content in SharePoint 2013 under Firefox browser, they are unable to open the listed results.

    Unable to open UNC path result in the Firefox browser, because the firefox cut out the server name from the unc path.
    The correct unc path is \\servername\foldername, in the firefox browser the listed result's uncp path is \\\foldername
    Thanks
    Thomas

    Unable to open UNC path result in the Firefox browser, because the firefox cut out the server name from the unc path.
    The correct unc path is \\servername\foldername, in the firefox browser the listed result's uncp path is \\\foldername
    Thanks
    Thomas

  • How do you search for file content in Mountain Lion?

    I recently upgrade my MacBook Pro to Mountain Lion. I used to use spotlight to search for specific content within files before the upgrade. Now spotlight is only giving me file names and won't allow me to search for content within the files, even if I used quotations in my search. Is this just a glich on my computer or is there something I need to reset? Thanks!

    Try rebuilding the Spotlight index.  Go into the Spotlight privacy pane, and then add your hard drive to the "privacy" section.  This will erase its index.  Then remove your hard drive from the index and Spotlight will rebuild  the index.  It will take an hour or two.

  • No YouTube content on AppleTV - searching for "Featured" forever

    I mean the once that I watched in "recent" section seem to work (although for few days they did not). However, the device still searches for content in Featured, Most Viewed and cannot find anything.
    I was wondering if Apple has some special URL that stopped working or perhaps something is blocked by ISP or on router. the fact is - no updates on ATV and everythin worked last week. this week it is missing service on ATV. On the other hand, my Macs can access youtube website. Same with iPod Touch - it is okay and working with YoTube on the same network as my Apple TV.
    I believe Apple uses special URL for Apple TV, but I might be wrong.
    Any ideas?

    I am not able to follow.  You can not download any DVD content to ATV.  Responses can only be as helpful as the details provided.  What is it you are doing exactly?  Where is this content comming from?

  • Spotlight: Search in content working on substrings

    If you search for content with Spotlight, you have to type the search phrase from the beginning, i.e. searching for files containing the word homework you could search for home or homework but not for work.
    Capitalization is important. So homeWork can be searched by home, homework and work but not by ork.
    Does anyone know, how to create a spotlight search, that does a true search for "contains in content" working on substrings as well?
    Peter

    Hello JSam23,
    Thanks for using Apple Support Communities.
    If Spotlight isn't bringing up expected search results, you can reindex Spotlight so it knows where those files are located.  Take a look at the information below on how you can do this.
    I do want to forewarn you though, that reindexing Spotlight, especially your entire hard drive, can take time depending on how full the hard drive is.  This can result in your computer seeming slow, or the fans running at a higher speed than normal.
    From the Apple () menu, choose System Preferences.
    Click Spotlight.
    Click the Privacy tab.
    Drag a folder or an entire volume (your hard drive) to the list.
    If prompted for confirmation, click OK.
    Remove the item or volume you just added to the list by clicking it and then clicking the minus ("-") button.
    Close Spotlight preferences.
    Spotlight will re-index the contents of the folder or volume.
    Spotlight: How to re-index folders or volumes - Apple Support
    Cheers,
    Alex H.

  • Search in Content DB

    When searching for content, there is a hit only if the "Look in" field is set to the
    folder where the document is located. It seems like "search in subfolders" does
    not work.
    And there is no a control to choose if the user wants to search in the current
    folder, or also in the subfolders.
    Regards
    Gerard De Maeyer

    Attributes.CREATED_BY is of type "Item".
    To submit a search, it is unrealistic to expect a client to provide an Item instance as the value in a SearchExpression.
    Rather, the client can instead provide the ID of a USER item instance, or alternatively, the NAME of a USER item instance, in place of the actual item instance itself.
    On the server-side, Content DB will lookup the ID value or NAME value to locate the appropriate user item instance and process the search accordingly.
    ManagersFactory session = ...
    UserManager userM = session.getUserManager();
    Item user = userM.getUser("max", null);
    SearchExpression docsCreatedByMax = new SearchExpression();
    docsCreatedByMax.setOperator(FdkConstants.OPERATOR_EQUAL);
    docsCreatedByMax.setLeftOperation(Attributes.CREATED_BY + FdkConstants.SEPARATOR + Attributes.ID);
    docsCreatedByMax.setRightOperand(new Long(user.getId());
    NamedValue[] options = ...
    AttributeRequest[] requestedAttributes = ....
    NamedValue[] searchResults = searchM.search(docsCreatedByMax, options, requestedAttributes);
    or alternatively ....
    SearchExpression docsCreatedByMax = new SearchExpression();
    docsCreatedByMax.setOperator(FdkConstants.OPERATOR_EQUAL);
    docsCreatedByMax.setLeftOperation(Attributes.CREATED_BY + FdkConstants.SEPARATOR + Attributes.NAME);
    docsCreatedByMax.setRightOperand("max");
    NamedValue[] options = ...
    AttributeRequest[] requestedAttributes = ....
    NamedValue[] searchResults = searchM.search(docsCreatedByMax, options, requestedAttributes);cheers
    Matt.

  • Search for a song in a playlist

    Hello.I would like to find out how can I search for a song in a playlist in iTunes on iOS (iPhone 5s)

    Hello WinXXx,
    Thank you for the question.  You can search for content in the Music app by tapping the status bar (the top bar of your iPhone where you see the time and battery information):
    Search music. While browsing, tap the status bar to reveal the search field at the top of the screen, then enter your search text. You can also search audio content from the Home screen. See Search.
    iPhone User Guide - Browse and play
    http://help.apple.com/iphone/7/#/iph3cf21a82
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

Maybe you are looking for