Sergey, I think I confused you. The comment about the fields listed in the "fl" parameter has nothing to do with the SolrJ calls not working.
For SolrJ calls not working my suggestion is to look at the logs and compare the GetMethod call with the SolrJ call. Paste them if you want more people to look at them. Otis -- Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch ----- Original Message ---- > From: SergeyG <sgoldb...@mail.ru> > To: solr-user@lucene.apache.org > Sent: Friday, July 3, 2009 4:08:37 AM > Subject: Re: Implementing PhraseQuery and MoreLikeThis Query in one app > > > Otis, > > Thanks a lot. I'd certainly follow your advice and check the logs. Although, > I must say that I've already tried all possible variations of the string for > the "fl" parameter (spaces, commas, plus signs). More than that - the query > still doesn't want to fetch any docs (other than the one with the id > specified in the query) even when the line solrQuery.setParam("fl", "title > author score"); is commented out. So I suspect that the problem is that the > request with the url > "http://localhost:8080/solr/select?q=id:1&mlt=true&mlt.fl=content&..." due > to some reason doesn't work properly. And when I use the GetMethod(url) > approach and send url directly in the form > "http://localhost:8080/solr/mlt?q=id:1&mlt.fl=content&...", Solr picks up > the mlt component. (At least, I'll have this backup solution if the main one > keeps committing sabotage. :) I'll just need to add a parser for an incoming > xml-response.) > > I'll continue my "research" of this issue and, if you're interested in > results, I'll definitely let you know. > > Cheers, > Sergey > > > Otis Gospodnetic wrote: > > > > > > Sergey, > > > > Glad to hear the suggestion worked! > > > > I can't spot the problem (though I think you want to use a comma to > > separate the list of fields in the fl parameter value). > > I suggest you look at the servlet container logs and Solr logs and compare > > requests that these two calls make. Once you see what how the second one > > is different from the first one, you will probably be able to figure out > > how to adjust the second one to produce the same results as the first one. > > > > Otis > > -- > > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch > > > > > > > > ----- Original Message ---- > >> From: SergeyG > >> To: solr-user@lucene.apache.org > >> Sent: Thursday, July 2, 2009 6:17:59 PM > >> Subject: Re: Implementing PhraseQuery and MoreLikeThis Query in one app > >> > >> > >> Otis, > >> > >> Your recipe does work: after copying an indexing field and excluding stop > >> words the MoreLikeThis query started fetching meaningful results. :) > >> > >> Just one issue remained. > >> > >> When I execute query in this way: > >> > >> String query = "q=id:1&mlt.fl=content&...&fl=title+author+score"; > >> HttpClient client = new HttpClient(); > >> GetMethod get = new GetMethod("http://localhost:8080/solr/mlt"); > >> get.setQueryString(query); > >> client.executeMethod(get); > >> ... > >> > >> it works fine bringing results as an XML string. > >> > >> But when I use "Solr-like" approach: > >> > >> String query = "id:1"; > >> solrQuery.setQuery(query); > >> solrQuery.setParam("mlt", "true"); > >> solrQuery.setParam("mlt.fl", "content"); > >> solrQuery.setParam("fl", "title author score"); > >> QueryResponse queryResponse = server.query( solrQuery ); > >> > >> the result contains only one doc with id=1 and no other "more like" docs. > >> > >> In my solrconfig.xml, I have these settings: > >> ... > >> > >> ... > >> > >> I guess it all is a matter of syntax but I can't figure out what's wrong. > >> > >> Thank you very much (and again, thanks to Michael and Walter). > >> > >> Cheers, > >> Sergey > >> > >> > >> > >> Michael Ludwig-4 wrote: > >> > > >> > SergeyG schrieb: > >> > > >> >> Can both queries - PhraseQuery and MoreLikeThis Query - be implemented > >> >> in the same app taking into account the fact that for the former to > >> >> work the stop words list needs to be included and this results in the > >> >> latter putting stop words among the most important words? > >> > > >> > Why would the inclusion of a stopword list result in stopwords being of > >> > top importance in the MoreLikeThis query? > >> > > >> > Michael Ludwig > >> > > >> > > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/Implementing-PhraseQuery-and-MoreLikeThis-Query-in-one-app-tp24303817p24314840.html > >> Sent from the Solr - User mailing list archive at Nabble.com. > > > > > > > > -- > View this message in context: > http://www.nabble.com/Implementing-PhraseQuery-and-MoreLikeThis-Query-in-one-app-tp24303817p24319269.html > Sent from the Solr - User mailing list archive at Nabble.com.