Presentation is loading. Please wait.

Presentation is loading. Please wait.

Oracle Text Operations J. Molka-Danielsen Sept. 30, 2002.

Similar presentations


Presentation on theme: "Oracle Text Operations J. Molka-Danielsen Sept. 30, 2002."— Presentation transcript:

1 Oracle Text Operations J. Molka-Danielsen Sept. 30, 2002

2 Index types Standard index type for traditional full-text retrieval over documents and web pages. The context index type provides a rich set of text search capabilities for finding the content you need, without returning pages of spurious results. Catalog index type – the first text index designed specifically for eBusiness catalogs. The ctxcat catalog index type provides flexible searching and sorting at web-speed. Classification index type for building classification or routing applications. The ctxrule index type is created on a table of queries, where the queries define the classification or routing criteria. Oracle Text offers index types for traditional full-text retrieval, eBusiness catalogs, and classification and routing applications.

3 Where the index is used Index TypeApplication Type Query Operator CONTEXT Use this index to build a text retrieval applicationCONTAINS when your text consists of large coherent documents. You can index documents of different formats such as MS Word, HTML, XML, or plain text. With a context index, you can customize your index in a variety of ways. CTXCAT Use this index type to index small textCATSEARCH fragments such as item names, prices and descriptions that are stored across columns. With this index, query performance is improved for mixed queries. CTXRULE Use a CTXRULE index to build a documentMATCHES classification application. The CTXRULE index is an index created on a table of queries, where each query has a classification. Single documents (plain text, HTML, or XML) can be classified using the MATCHES operator.

4 Query operator strategies Keyword searching. - Searching for keywords in a document. User enters one or more keywords that best describe the query. Context queries. - Searching for words in a given context. User search for text that contains words near to each other. Boolean operations. - Combining keywords with Boolean operations. User can express a query connecting Boolean operations to the keywords. Linguistics features. - Using fuzzy and other natural language processing techniques. User searches for text that is about something. Pattern matching. - Retrieval of text that contains a certain property. User searches for text that contains words that contain a string.

5 Features Languages - Oracle Text supports all Oracle NLS character-sets. For example, ASCII, UTF-8, JA165JIS, GBK, BIG5, etc. Oracle Text supports search across documents in western languages (English, French, Spanish, German, etc.), Japanese, Korean, Traditional, and Simplified Chinese engine. Highlighting - The highlight service takes a query string, fetches the document contents, and shows you which words in the document cause it to match the query. Markup - Markup takes the highlight service one step further, and produces a text version of the document with the matching words marked up.

6 Features continued Theme Extraction - A “Theme” provides a snapshot that describes what the document is about. Rather than searching for documents that contain specific words or phrases, users can search for documents that are about a certain subject, even if that subject is not mentioned explicitly in the document. Theme queries return a hit list of those documents that are about the requested subject, along with a score that indicates how strongly each document reflects to the subject in question. Gist - A Generic Gist is a summary consisting of the sentences or paragraphs, which best represent the overall subject matter of the document. You can use the Generic Gist to skim the main content of the text, or assess your interest in the text's subject matter. You can generate paragraph-level or sentence-level gists.

7 Advanced Linguistics A document classification application is one that classifies an incoming stream of documents based on their content. These are known as document routing or filtering applications. For example, an online news agency might need to classify its incoming stream of articles as they arrive into categories such as politics, economy, or sports. Oracle Text enables you to build such applications with the new CTXRULE index type. This index type indexes the rules (queries) that define classifications or routing criteria. When documents arrive, the new MATCHES operator can be used to categorize each document. The CTX_CLS package generates CTXRULE query rules for a set of documents. The user has to supply a training set consisting of categorized documents and each document must belong to one or more categories. The package generates the queries that define the categories and then writes the results to a table.

8 Examples Creating Indexes with Oracle Text Let’s assume the following table containing some typical product information. > describe product_information Name Null? Type ------------------------ ------- ---------------- PRODUCT_ID NOT NULL NUMBER(6) PRODUCT_NAME VARCHAR2(50) PRODUCT_DESCRIPTION VARCHAR2(2000) CATEGORY NUMBER(2) PRODUCT_STATUS VARCHAR2(20) LIST_PRICE NUMBER(8,2)

9 Create index We would like to create a text index on the PRODUCT_DESCRIPTION column to make it searchable. The index creation is a SQL statement: CREATE INDEX description_idx ON product_information(product_description) INDEXTYPE IS CTXSYS.CONTEXT;

10 Select and result SELECT score(1), product_id, product_name FROM product_information WHERE CONTAINS (product_description, 'monitor NEAR "high resolution"', 1)>0 ORDER BY score(1) DESC; SCORE(1) PRODUCT_ID PRODUCT_NAME ---------- ---------- ------------------------ 29 3331 Monitor 21/HR 27 3060 Monitor 17/HR 14 1726 LCD Monitor 11/PM 14 3054 Plasma Mon 10/XGA 14 2252 Monitor 21/HR/M 14 2243 Monitor 17/HR/F

11 Another example on creating a contex index Specifying DIRECT_DATASTORE - The following example creates a table with a CLOB column to store text data. It then populates two rows with text data and indexes the table using the system-defined preference CTXSYS.DEFAULT_DATASTORE. create table mytable(id number primary key, docs clob); insert into mytable values(111555,'this text will be indexed'); insert into mytable values(111556,'this is a direct_datastore example'); commit; create index myindex on mytable(docs) indextype is ctxsys.context parameters ('DATASTORE CTXSYS.DEFAULT_DATASTORE');

12 Specifying file data storage The following example creates a data storage preference using the FILE_DATASTORE. This tells the system that the files to be indexed are stored in the operating system. The example uses CTX_DDL.SET_ATTRIBUTE to set the PATH attribute of to the directory /docs. begin ctx_ddl.create_preference('mypref', 'FILE_DATASTORE'); ctx_ddl.set_attribute('mypref', 'PATH', '/docs'); end;

13 References 1. Oracle Text Reference Guide. Oracle Corp., Redwood Shores, CA (2002). 2. Oracle Text Application Developer’s Guide. Oracle Corp., Redwood Shores, CA (2002). 3. Oracle Text Home Page (http://otn.oracle.com/products/text/) 4. Oracle Text Discussion Forum (http://otn.oracle.com/forums/text.html)


Download ppt "Oracle Text Operations J. Molka-Danielsen Sept. 30, 2002."

Similar presentations


Ads by Google