For indexing blob column I added clob column wich is always null,
made pl/sql function to convert blob data to clob and used ExtraCols to specify this function call in index creation.
Is there more simple way to index blob column without adding clob column?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Igor:
BLOB is not supported by LDI because there is no way to know the encoding form of the information stored on it.
The trick is to use ExtraCols parameter and PLSQL function to convert a BLOB to CLOB (utf8) or VARCHAR2 (32K max.)
for example for a table:
create table test (id number primary key, myblob BLOB)
an index like this:
create index test_lidx on test(id) parameters
('IncludeMasterColumn:false;ExtraCols:Pkg.MyBlobToClob(myblob) "text";DefaultColumn:text');
the pragma restriction for above function should be:
usually during indexing time a common use case is to index first 10K of text, in that case a simple BLOB->VARCHAR2 function will do the job.
Best regards, Marcelo.
PD: Note that IncludeMasterColumn:false parameters means that id will be not indexed, only blob column will be indexed as text field, if you want to index also id column remove this parameter. DefaultColumn:text is added to change Lucene default column field name that if not added will be ID which is the master column of the index.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For indexing blob column I added clob column wich is always null,
made pl/sql function to convert blob data to clob and used ExtraCols to specify this function call in index creation.
Is there more simple way to index blob column without adding clob column?
Igor:
BLOB is not supported by LDI because there is no way to know the encoding form of the information stored on it.
The trick is to use ExtraCols parameter and PLSQL function to convert a BLOB to CLOB (utf8) or VARCHAR2 (32K max.)
for example for a table:
an index like this:
the pragma restriction for above function should be:
usually during indexing time a common use case is to index first 10K of text, in that case a simple BLOB->VARCHAR2 function will do the job.
Best regards, Marcelo.
PD: Note that IncludeMasterColumn:false parameters means that id will be not indexed, only blob column will be indexed as text field, if you want to index also id column remove this parameter. DefaultColumn:text is added to change Lucene default column field name that if not added will be ID which is the master column of the index.