Home » Server Options » Text & interMedia » Offset characters in Snippet for html files
Offset characters in Snippet for html files [message #383627] Thu, 29 January 2009 06:24
miharoscabv
Messages: 5
Registered: January 2009
Junior Member
Hi,

I want to make a search on a html file on Oracle 11 g and I created the following scripts:

SQL> CREATE TABLE Search (fileid NUMBER PRIMARY KEY, filepath VARCHAR2 (30));

Table created

SQL> INSERT INTO Search VALUES (1, 'c:\test.htm');

1 row inserted

SQL> CREATE INDEX SearchIndex ON Search (filepath) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('DATASTORE CTXSYS.FILE_DATASTORE filter ctxsys.auto_filter');

Index created

SQL> SELECT CTX_DOC.SNIPPET ('searchindex',TO_CHAR (FILEID), 'help') FROM search WHERE CONTAINS (FILEPATH, 'help', 1) > 0;

CTX_DOC.SNIPPET('SEARCHINDEX',



--------------------------------------------------------------------------------
p> <p> </p> <p>High-value help content:</p> <p> </p> <p





My html file contains the following text:

<?xml version="1.0" encoding="utf-8"?>
<html>
<head><title>Filtering notifications in your Inbox</title>
</head>
<body>


It will
provide procedures for creating filters, editing existing filters, copying
filters, and deleting filters.



High-value help content:



Related topic: Viewing and managing notifications in your Inbox.

</body>
</html>

I created also the procedure

create or replace procedure TestareSnippet(
p_indexName IN VARCHAR2,
p_fileID IN CHAR,
p_textSearch IN VARCHAR2,
p_result OUT VARCHAR2)
IS
BEGIN
p_result := ctx_doc.snippet(p_indexName, p_fileID , p_textSearch, '','', FALSE,'..');
end TestareSnippet;

and I received the same results.

Is there any way so that the Snippet doesn't return the incompleted tags from the begining and the ending of the results? I noticed that some times is not displaying them, it depends on the content of the file.

Thank you very much!
Previous Topic: Indexing comma delimited Info.-
Next Topic: Index Type CTXSYS.CONTEXT not being used, any help?
Goto Forum:
  


Current Time: Thu Mar 28 17:47:09 CDT 2024