Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Indexing file starting with <job id="MHS">

pcpaascheAug 23 2017 — edited Jan 29 2018

select * from v$version:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

PL/SQL Release 12.1.0.2.0 - Production

CORE 12.1.0.2.0 Production

TNS for Linux: Version 12.1.0.2.0 - Production

NLSRTL Version 12.1.0.2.0 - Production

I have a file named TEST_FILE.txt, that has a first line like this:

<job id="MHS">

When running Oracle Text, the file does not get indexed, at least it is not returned when I query for a word any the file.

However, if I change the first line in the file TEST_FILE.txt to this:

#<job id="MHS">

, then the file is indexed and I get a result when querying for any given word in the file.

Why is that? What can I do to have the file indexed when it starts with <job id="MHS"> ?

I want to treat the file as an ordinary text file where all words are available in the index, no matter what tags there are in the beginning of the file or in the rest of the file.

---------------------

Some background info of my setup:

EXECUTE ctx_ddl.create_preference('URL_PREF', 'URL_DATASTORE');

EXECUTE     CTX_DDL.CREATE_PREFERENCE ('blackcode_lexer', 'BASIC_LEXER');

EXECUTE     CTX_DDL.SET_ATTRIBUTE ('blackcode_lexer', 'PRINTJOINS', '_');

CREATE INDEX BLACKCODE.SOURCE_CODE_SEARCH_IDX1

   ON BLACKCODE.SOURCE_CODE_SEARCH(HTTP_URL)

   INDEXTYPE IS CTXSYS.CONTEXT

      PARAMETERS('filter ctxsys.null_filter Datastore URL_PREF LEXER blackcode_lexer')

NOPARALLEL;

My query:

SELECT *

        FROM blackcode.SOURCE_CODE_SEARCH

       WHERE CONTAINS(http_url, 'job id' , 1) > 0;

This post has been answered by Bud Light on Aug 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2017
Added on Aug 23 2017
1 comment
316 views