![]() This example also uses the HTML_SECTION_GROUP section group, which is recommended for indexing HTML documents. However, if you index PDF, Microsoft Word, or other formatted documents, then use the CTXSYS.AUTO_FILTER (the default) as your FILTER preference. Use the NULL_FILTER, because you do not need to filter HTML documents during indexing. ('FILTER CTXSYS.NULL_FILTER SECTION GROUP CTXSYS.HTML_SECTION_GROUP') Because you are indexing HTML, this example uses the NULL_FILTER preference type for no filtering and the HTML_SECTION_GROUP type: Index the HTML files by creating a CONTEXT index on the text column as follows. See Also: "Building the Web Application" for an example on how to use SQL*Loader to load a text table from a data file Step 1 Create the CONTEXT index You can also load your table in batch with SQL*Loader. INSERT INTO docs VALUES(3, 'France is in Europe.') INSERT INTO docs VALUES(2, 'Paris is a city in France.') INSERT INTO docs VALUES(1, 'California is a state in the US.') ![]() To populate the docs table, use the INSERT statement as follows: Use the SQL INSERT statement to load text to a table. The text column is VARCHAR2.ĬREATE TABLE docs (id NUMBER PRIMARY KEY, text VARCHAR2(200)) This example makes the id column the primary key. The following example creates a table called docs with two columns, id and text, by using the CREATE TABLE statement. Step 1 Connect as the New Userīefore creating any tables, assume the identity of the user you just created. An example of how to build such a query application using the CONTEXT index type is given in Appendix A. Typically, query applications require a user interface. This example steps you through the basic SQL statements to load the text table, index the documents, and query the index. Such an application involves creating a CONTEXT index and querying it with CONTAINS. In a basic text query application, users enter query words or phrases and expect the application to return a list of documents that best match the query. GRANT EXECUTE ON CTXSYS.CTX_ULEXER TO myuser ![]() GRANT EXECUTE ON CTXSYS.CTX_THES TO myuser GRANT EXECUTE ON CTXSYS.CTX_REPORT TO myuser GRANT EXECUTE ON CTXSYS.CTX_QUERY TO myuser GRANT EXECUTE ON CTXSYS.CTX_OUTPUT TO myuser GRANT EXECUTE ON CTXSYS.CTX_DOC TO myuser GRANT EXECUTE ON CTXSYS.CTX_DDL TO myuser GRANT EXECUTE ON CTXSYS.CTX_CLS TO myuser For example, to grant to MYUSER execute privileges on all Oracle Text packages, enter the following SQL statements: To call any of these procedures from a stored procedure, your application requires execute privileges on the packages. The Oracle Text Reference describes each of these packages in its own chapter. For example, the CTX_DDL package includes the SYNC_INDEX procedure, which enables you to synchronize your index. Oracle Text includes several packages that let you perform actions ranging from synchronizing an Oracle Text index to highlighting documents. Step 3 Grant EXECUTE Privileges on CTX PL/SQL Packages GRANT RESOURCE, CONNECT, CTXAPP TO MYUSER The following SQL statement grants the required roles of RESOURCE, CONNECT, and CTXAPP to MYUSER: The following SQL statement creates a user called MYUSER with a password of myuser_password:ĬREATE USER myuser IDENTIFIED BY myuser_password To create an Oracle Text application developer user, do the following as the system administrator user: Step 1 Create User This role enables you to do the following:Ĭreate and delete Oracle Text indexing preferences ![]() Before you can create Oracle Text indexes and use Oracle Text PL/SQL packages, you need to create a user with the CTXAPP role.
0 Comments
Leave a Reply. |