On 3/17/2016 4:20 AM, Adel Mohamed Khalifa wrote:
> And on servlet I coded :-
> Try{
> SolrServer server = new
> HttpSolrServer(Core.solrResourceBundle.getString("//http://172.16.0.1:8983/S
> earchCore"));
>             ModifiableSolrParams params = new ModifiableSolrParams();
>             String qqq = new
> String(request.getParameter("qu").getBytes("ISO-8859-1"), "UTF-8");
>             params.set("q", new
> String(request.getParameter("qu").getBytes("ISO-8859-1"), "UTF-8"));
>             params.set("rows", "30000");
>             params.set("spellcheck", "on");
>             params.set("spellcheck.build", "true");
>             params.set("wt", "json");
>             params.set("indent", "true");
>             
>             QueryResponse res = server.query(params);
>             SolrDocumentList results = res.getResults();
>             Iterator i = results.iterator();
>             request.setAttribute("size", results.size());
>             String json = new Gson().toJson(res.getResults());
>             out.write(json);
> } catch (SolrServerException ex) {
>             oout.write(ex.toString());
>         }
> }
>
> It's break on SolrServer server = new
> HttpSolrServer(Core.solrResourceBundle.getString("//http://172.16.0.1:8983/S
> earchCore")); without any exception just stop.

This code looks different than the last code you said you were using,
when you posted to the dev list.  Have you included the real code this
time?  I can see at least two typos that would make the code refuse to
compile, so I'm guessing you're still changing it, not showing the
actual code.

What exactly does the following code return?

Core.solrResourceBundle.getString("//http://172.16.0.1:8983/SearchCore";)

What version of SolrJ are you using?  I'm not asking about the Solr
server version here although that would be good to know as well. I'm
guessing a 4.x version, or I think you'd be using HttpSolrClient, not
HttpSolrServer.  The latter will work on 5.x, but it is deprecated.

Thanks, Shawn

Reply via email to