Hi,
As far as I know, there's no specific method to get the MoreLikeThis section
from the response. Anyway, you can retrieve the results with a piece of code
like the following:
// the lst name=moreLikeThis is a NamedList of SolrDocumentLists
NamedListSolrDocumentList mltResult =
(NamedListSolrDocumentList)response.getResponse().get(moreLikeThis);
for(Map.EntryString, SolrDocumentList entry: mltResult) {
System.out.println(Docs similar to + entry.getKey());
for(SolrDocument similarDoc: entry.getValue()) {
System.out.println( - + similarDoc.get(id));
}
}
Hope that helps!
*Juan*
On Fri, Jul 1, 2011 at 3:04 PM, Sheetal rituzprad...@gmail.com wrote:
Hi,
I am beginner in Solr. I am trying to read data from Solr MoreLike This
through Java. My query is
http://localhost:8983/solr/select?q=repository_id:20mlt=truemlt.fl=filenamemlt.mindf=1mlt.mintf=1debugQuery=onmlt.interestingTerms=detail
I wanted to read the data of the field moreLikeThis from output lst
name=moreLikeThis.
The main idea is, after I do moreLikeThis, then all fieldValue of
moreLikeThis should print out in my program.
I figured out the way to read the Result tag by doing QueryResponse
rsp.getResults() and looping out.
But How would I read and print the values of moreLikeThis tag? Is there
anyway class like rsp.getMoreLikeThisField(fieldname) or something.
Thank you in advance. :)
--
View this message in context:
http://lucene.472066.n3.nabble.com/Reading-data-from-Solr-MoreLikeThis-tp3130184p3130184.html
Sent from the Solr - User mailing list archive at Nabble.com.