Menu

#9 null pointer exception for a sorted select

open
nobody
None
5
2010-12-28
2010-12-28
gennff
No

hi,

doing the email table example i get a null pointer exception for a sorted select like this:

SELECT /*+ DOMAIN_INDEX_SORT */ subject FROM emails where lcontains(bodytext, 'Paris', 'subject:ASC:string', 1) > 0

the exception stack reads like this:

28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl start
INFO: Getting caching info entry: Entry: dir: 237000869 reader: org.apache.lucene.index.ReadOnlyDirectoryReader@b8996bdf searcher: org.apache.lucene.search.IndexSearcher@9dc65ee7 updateCount: 2 dir: org.apache.lucene.store.OJVMDirectory@e2058a5
28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl start
INFO: Indexing column: 'BODYTEXT'
28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl start
INFO: Analyzer: org.apache.lucene.analysis.StopAnalyzer@1ad5dcf
28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl start
INFO: trackMaxScore: false docsScoredInOrder: false
28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl start
INFO: searcher: -1647943961 qryStr: subject:ASC:string(paris)noScore
28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl start
INFO: storing cachingFilter: QueryWrapperFilter(BODYTEXT:paris) key: paris
28.12.2010 17:21:54 org.apache.lucene.indexer.IndexScanImpl getSort
INFO: using sort: <string: "subject">
java.lang.ArrayIndexOutOfBoundsException
at org.apache.lucene.search.FieldCacheImpl$StringIndexCache.createValue(FieldCacheImpl.java:641)
at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:183)
at org.apache.lucene.search.FieldCacheImpl.getStringIndex(FieldCacheImpl.java:611)
at org.apache.lucene.search.FieldComparator$StringOrdValComparator.setNextReader(FieldComparator.java:805)
at org.apache.lucene.search.TopFieldCollector$OneComparatorNonScoringCollector.setNextReader(TopFieldCollector.java:96)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:217)
at org.apache.lucene.search.Searcher.search(Searcher.java:88)
at org.apache.lucene.indexer.IndexScanImpl.start(IndexScanImpl.java:196)
at org.apache.lucene.indexer.LuceneDomainIndex.ODCIStart(LuceneDomainIndex.java:1406)

the underlying objects where created like this:

drop table emails;
create table emails (
emailFrom VARCHAR2(256),
emailTo VARCHAR2(256),
subject VARCHAR2(4000),
emailDate DATE,
bodyText CLOB);

INSERT INTO EMAILS (EMAILFROM, EMAILTO, SUBJECT, EMAILDATE, BODYTEXT)
select trim(extractValue(obj, '/article/@author_from_addr')) as author_from_addr,
trim(extractValue(obj, '/article/@imp_channel')) as imp_channel,
trim(extractValue(obj, '/article/contents/title/text()')) as title,
to_date(extractValue(obj, '/article/@import_ts'), 'dd.mm.yyyy hh24.mi.ss') as import_ts,
trim(extractValue(obj, '/article/contents/body/text()')) as body
from (
select xmltype(replace(replace(replace(replace(replace(replace(
orig_xml,
chr(13), ' '), chr(10), ' '), chr(9), ' '), '<p>'), '</p>'), ' ', '')) as obj
from artikel_imp_xml
where dbms_lob.getlength(orig_xml) < 4000 --xml_imp_id = 3613
);
commit;

drop index emailbodyText force;
create index emailbodyText on emails(bodyText) indextype is lucene.LuceneIndex parameters(
'LogLevel:INFO;Analyzer:org.apache.lucene.analysis.StopAnalyzer;ExtraCols:emailDate "emailDate",subject "subject",emailFrom "emailFrom",emailTo "emailTo"');

alter index emailbodyText parameters(
'LogLevel:INFO;FormatCols:subject(NOT_ANALYZED),emailFrom(NOT_ANALYZED),emailTo(NOT_ANALYZED)');

hope you can help! regards peter

Discussion

  • Marcelo F. Ochoa

    Hi:
    I can reproduce the error using testSchemaEmail.sql and testEmail.xml SQLUnit test suites.
    Could you execute the target:
    ant test-odi
    and check if the test suite testEmails.xml run OK.
    In the other hand if you change the column property to subject(NOT_ANALYZED) a good idea is to add the parameter rebuild, for example:
    alter index emailbodyText rebuild parameters(
    'LogLevel:INFO;FormatCols:subject(NOT_ANALYZED),emailFrom(NOT_ANALYZED),emailTo(NOT_ANALYZED)');
    Best regards, Marcelo.

     
  • gennff

    gennff - 2011-01-03

    hi marcelo,

    i did run the full test suite and logged the output into a file which you will find attached. there are probably other issues because the output does not only log errors for the test-email sqlunit. please have a look at the other faulty units as well.

    of course, i may need to add the rebuild parameter to have the statement make real sense. however, i am only doing my first steps with lucene-odi and lucene, and in such a way may attempt for "unconventional" approaches. do forgive me doing so this time. i am still experimenting.

    as a part of my first steps i also did a full installation on a 10g and shared my experiences on bitbach.wordpress.com (mostly outdated installation instructions, a probable gap between 10g and 11g, some quirks with environment variables and so on). i also informed you to have a look at the post via your blog but did not yet get any reply or notification. are you are still following comments on your blog? would be very nice to discuss this subject as well, probably in another thread?

    regards peter

     
  • gennff

    gennff - 2011-01-03

    test-odi target console output

     
  • Nobody/Anonymous

    hi marcelo,

    any news on that?

    regards peter

     

Log in to post a comment.

Auth0 Logo