lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George L" <georgel2...@gmail.com>
Subject MoreLikeThis throwing NPE
Date Sun, 09 Sep 2007 16:57:09 GMT
I have been trying the MLT Query using EmbeddedSolr and SolrJ clients, which
is resulting in NPE.

It looks like a problem as mentioned here
https://issues.apache.org/jira/browse/LUCENE-819
If that is the case,how to fix this?

The MLT field has been stored with termvectors.

The query i used and the exception is below.

In debug mode Lucene term.hascode() has been receiving some fields in the
index and breaking with the id field,
I was hoping to see the exception happening bcos of the mlt
fields/fieldValues. But it didn't.

Can somebody help me please, i have already spent a whole saturday night
with the trunk code ;-(

SolrQuery q = new SolrQuery();
        q.setQuery( "id:100001");
        q.addFacetField("l");
        q.setFacet(true);
        q.setFacetMinCount(1);
        q.setParam("mlt", true);
        q.setParam("mlt.fl","field1");
        q.setParam("mlt.minwl","1");
        q.setParam("mlt.mintf","1");
        q.setParam("mlt.mindf","1");
QueryResponse response = server.query( q );



SEVERE: java.lang.NullPointerException
    at org.apache.lucene.index.Term.hashCode(Term.java:78)
    at org.apache.lucene.search.TermQuery.hashCode (TermQuery.java:175)
    at org.apache.lucene.search.BooleanClause.hashCode(BooleanClause.java
:108)
    at java.util.AbstractList.hashCode(AbstractList.java:630)
    at org.apache.lucene.search.BooleanQuery.hashCode (BooleanQuery.java
:445)
    at org.apache.solr.search.QueryResultKey.<init>(QueryResultKey.java:47)
    at org.apache.solr.search.SolrIndexSearcher.getDocListC(
SolrIndexSearcher.java:725)
    at org.apache.solr.search.SolrIndexSearcher.getDocListAndSet (
SolrIndexSearcher.java:1241)
    at
org.apache.solr.handler.MoreLikeThisHandler$MoreLikeThisHelper.getMoreLikeThis
(MoreLikeThisHandler.java:280)
    at
org.apache.solr.handler.MoreLikeThisHandler$MoreLikeThisHelper.getMoreLikeThese(
MoreLikeThisHandler.java:310)
    at org.apache.solr.handler.StandardRequestHandler.handleRequestBody(
StandardRequestHandler.java:142)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(
RequestHandlerBase.java :78)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:894)
    at org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(
EmbeddedSolrServer.java:106)
    at org.apache.solr.client.solrj.request.QueryRequest.process (
QueryRequest.java:80)
    at org.apache.solr.client.solrj.impl.BaseSolrServer.query(
BaseSolrServer.java:99)
    at my.padam.solr.SolrJQueryTest.testQuery(SolrJQueryTest.java:134)
    at my.padam.solr.SolrJQueryTest.main (SolrJQueryTest.java:165)
-- 
Thanks
George L

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message