Hi.

After upgrading to solr 3.3.0 from 1.4.0, I noticed that I couldn't get the
MoreLikeThisHandler to return debugging data. I tried the debug parameters
 debugQuery and debug, but all I got was:
 <bool name="debug">true</bool>

I took a look at the code for the MoreLikeThisHandler, and noted in the
debbuging part that the handler is adding the variable dbg to the response
(line 211):
 rsp.add("debug", dbg);

Such variable is created at line 197:

boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);


I suppose the correct variable to add to the response would be dbgInfo:

NamedList<Object>
<http://javasourcecode.org/html/open-source/solr/solr-3.3.0/org/apache/solr/common/util/NamedList.java.html>
dbgInfo = SolrPluginUtils.doStandardDebug(req, q,
mlt.getRawMLTQuery(), mltDocs.docList);
        if (null != dbgInfo) {
          if (null != filters) {
            
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
            List<String>
<http://javasourcecode.org/html/open-source/jdk/jdk-6u23/java/util/List.java.html>
fqs = new ArrayList<String>
<http://javasourcecode.org/html/open-source/jdk/jdk-6u23/java/util/ArrayList.java.html>(filters.size());
            for (Query
<http://javasourcecode.org/html/open-source/lucene/lucene-3.3.0/org/apache/lucene/search/Query.java.html>
fq : filters) {
              fqs.add(QueryParsing.toString(fq, req.getSchema()));
            }
            dbgInfo.add("parsed_filter_queries",fqs);
          }

Summarizing, i believe line 211 should be changed to:

rsp.add("debug", dbgInfo);

Thanks a lot,

Andrés Cobas

Reply via email to