NullPointerException when building Index from Solr Index

28 views
Skip to first unread message

Tim Hearn

unread,
Oct 15, 2015, 2:30:11 PM10/15/15
to Semantic Vectors
Hi folks, I am trying to build an index with this package.  I am using the following versions of the following projects:
v 5.8 Semantic Vectors
v 5.0.0 Apache Solr 
v 4.10.0 (backed up-Lucene index)

When I try to build an index, I use the following command:

java -classpath semanticvectors-5.8.jar pitt.search.semanticvectors.BuildIndex -luceneindexpath C:\Users\tim\workspace\solr-5.0.0\server\solr\collection1\data\index -contentsfields textProperty


And get the following error

Seedlength: 10, Dimension: 200, Vector type: REAL, Minimum frequency: 0, Maximum frequency: 2147483647, Number non-alphabet characters: 2147483647, Contents fields are: [textproperty]
Initialized LuceneUtils from Lucene index in directory: C:\Users\tim\workspace\solr-5.0.0\server\solr\collection1\data\index
Creating term vectors as superpositions of elemental document vectors ... 
Initialized LuceneUtils from Lucene index in directory: C:\Users\tim\workspace\solr-5.0.0\server\solr\collection1\data\index
Creating semantic term vectors ...
There are 24878 terms (and 8592 docs).
Training term vectors for field textproperty
Processed 0 terms ... Exception in thread "main" java.lang.NullPointerException
at pitt.search.semanticvectors.LuceneUtils.getExternalDocId(LuceneUtils.java:191)
at pitt.search.semanticvectors.TermVectorsFromLucene.trainTermVectors(TermVectorsFromLucene.java:158)
at pitt.search.semanticvectors.TermVectorsFromLucene.createTermVectorsFromLuceneImpl(TermVectorsFromLucene.java:115)
at pitt.search.semanticvectors.TermVectorsFromLucene.createTermVectorsFromLucene(TermVectorsFromLucene.java:98)
at pitt.search.semanticvectors.BuildIndex.main(BuildIndex.java:117)


What can I do / change to get this to work? 

Dominic Widdows

unread,
Oct 15, 2015, 2:32:54 PM10/15/15
to semanti...@googlegroups.com
Hi Tim,

It might be that you need to set an appropriate -docidfield. See https://github.com/semanticvectors/semanticvectors/blob/wiki/SolrAndSemanticVectors.md.

Please let me know if this works. If so, I guess a change to the error message to list the available fields in the underlying lucene index might help?

Best wishes,
Dominic

--
You received this message because you are subscribed to the Google Groups "Semantic Vectors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semanticvecto...@googlegroups.com.
To post to this group, send email to semanti...@googlegroups.com.
Visit this group at http://groups.google.com/group/semanticvectors.
For more options, visit https://groups.google.com/d/optout.

Tim Hearn

unread,
Oct 15, 2015, 2:48:43 PM10/15/15
to Semantic Vectors
Yes, that works perfectly, thank you so much!  I think an error message with a list of available fields would be very helpful.

Dominic

unread,
Nov 10, 2015, 8:29:37 PM11/10/15
to Semantic Vectors
Belatedly, I took a look at this and the message ending with "Check that -docidfield was set correctly and exists in the Lucene index" was there in the code, but not getting output because the catch only looked for IOException and needed to check for NullPointerException as well. Fixed in github.

-Dominic
Reply all
Reply to author
Forward
0 new messages