MoreLikeThis throwing NPE

2007-09-09 Thread George L
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:11);
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


Re: MoreLikeThis throwing NPE

2007-09-09 Thread Ryan McKinley

George L wrote:

I have been trying the MLT Query using EmbeddedSolr and SolrJ clients, which
is resulting in NPE.



Do you get the same error without solrj?

Can you run the same query with:
  http://localhost:8987/solr/select?q=id:11mlt=true

(just to make sure we only need to look at the MLT code)

ryan


Re: MoreLikeThis throwing NPE

2007-09-09 Thread Ryan McKinley


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



Also, do you get the same error with an empty database?