lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Kan <solrexp...@gmail.com>
Subject Re: solrj returning no results but curl can get them
Date Fri, 30 Jan 2015 09:27:07 GMT
Hi,

Some sanity checking: does the solr server base url in the code match the
one you use with curl?

What if you curl against http://myserver/myapp/
<http://myserver/myapp/myproduct%5C> ? <http://myserver/myapp/myproduct%5C>

On Fri, Jan 30, 2015 at 5:58 AM, S L <sol.lederman@gmail.com> wrote:

> I'm stumped. I've got some solrj 3.6.1 code that works fine against three
> of
> my request handlers but not the fourth. The very odd thing is that I have
> no
> trouble retrieving results with curl against all of the result handlers.
>
> My solrj code sets some parameters:
>
>         ModifiableSolrParams params = new ModifiableSolrParams();
>
>         params.set("fl","*,score");
>         params.set("rows","500");
>         params.set("qt","/"+product);
>         params.set("hl", "on");
>         params.set("hl.fl", "title snippet");
>         params.set("hl.fragsize",500000);
>         params.set("hl.simple.pre","");
>         params.set("hl.simple.post","");
>
>         queryString = "(" + queryString + s[s.length-1] + ")";
>
> I have various request handlers that key off of the product value. I'll
> call
> the one that doesn't work "myproduct".
>
> I send the parameter string to catalina.out for debugging:
>
>             System.out.println(params.toString());
>
> I get this:
>
>
>
> fl=*%2Cscore&rows=500&qt=%2Fmyproduct&hl=on&hl.fl=title+snippet&hl.fragsize=500000
>             &hl.simple.pre=%3Cspan+class%3D%22hlt%22%3E
>
>
> &hl.simple.post=%3C%2Fspan%3E&q=title%3A%28brain%29+OR+snippet%3A%28brain%29
>
> I get no results when I let the solrj code do the search although the code
> works fine with the other three products.
>
> To convince myself that there is nothing wrong with the data I unencode the
> parameter string and run this command:
>
>             curl "http://myserver/myapp/myproduct\
>
>
> fl=*,score&rows=500&qt=/myproduct&hl=on&hl.fl=title+snippet&hl.fragsize=500000\
>                &hl.simple.pre=<span+class=&quot;hlt&quot;>&hl.simple.post=\
>                &q=title:brain%20OR%20snippet:brain"
>
> It runs just fine.
>
> How can I debug this?
>
> Thanks very much.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solrj-returning-no-results-but-curl-can-get-them-tp4183053.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Dmitry Kan
Luke Toolbox: http://github.com/DmitryKey/luke
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan
SemanticAnalyzer: www.semanticanalyzer.info

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