It’s Solr-5.3.0.
Please check the attachment you will find the code of the servlet called by
JavaScript and return the json file to get the results.
Regards,
Adel Khalifa
From: Iker Huerga [mailto:[email protected]]
Sent: Sunday, March 13, 2016 1:45 PM
To: [email protected]
Subject: Re: SolrJ ubuntu Problem
What version of solrj are you using? can you share the code?
Also, keep in mind that solrj uses SLF4J and Apache Commons Logging, so you
will need an implementation of these in your classpath to see the logs, take a
look at https://wiki.apache.org/solr/SolrLogging#SolrJ_and_Logging_Jars
2016-03-13 7:37 GMT-04:00 Adel Mohamed Khalifa <[email protected]>:
I edited and add the core but still nothing .. although the code in try and
Catch but I did not get any exception just stop.
Other side when I run the code in windows platform I get the result correctly.
Regards,
Adel Khalifa | Developer | Saudisoft-Egypt | Tel: +2 023 303 2037 - ext 112 |
M +2 01149247744 <tel:%2B2%2001149247744> | Fax +2 023 303 2036 | Follow us on
<https://www.facebook.com/pages/Saudisoft-Co-Ltd/289968997768973?ref_type=bookmark>
Description: cid:[email protected] |
<https://twitter.com/Saudisoft> Description: cid:[email protected]
|
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name&trkInfo=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
Description: cid:[email protected]
Description: cid:[email protected]
From: Iker Huerga [mailto:[email protected]]
Sent: Sunday, March 13, 2016 1:33 PM
To: [email protected]
Subject: Re: SolrJ ubuntu Problem
Try adding the core/collection name in the url as in
HttpSolrServer server = new
HttpSolrServer("http://localhost:8080/solr/collection1");
2016-03-13 6:12 GMT-04:00 Adel Mohamed Khalifa <[email protected]>:
Hello,
I am facing a problem when I try to connect to the Solr Server (HttpSolrServer
server = new HttpSolrServer("http://localhost:8983/solr");)
Note that my platform is Ubuntu and I install solr server on it and it work
correctly when I try to log on through browser but when I try in netbeans I
face the problem.
I hope you help me, Thanks
Regards,
Adel Khalifa | Developer | Saudisoft-Egypt | Tel: +2 023 303 2037 - ext 112 |
M +2 01149247744 <tel:%2B2%2001149247744> | Fax +2 023 303 2036 | Follow us on
<https://www.facebook.com/pages/Saudisoft-Co-Ltd/289968997768973?ref_type=bookmark>
Description: cid:[email protected] |
<https://twitter.com/Saudisoft> Description: cid:[email protected]
|
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name&trkInfo=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
Description: cid:[email protected]
Description: cid:[email protected]
--
Iker Huerga
http://www.ikerhuerga.com/
--
Iker Huerga
http://www.ikerhuerga.com/
protected void processRequest(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try {
SolrServer server = new
HttpSolrServer("http://localhost:8983/solr/SearchCore");
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");
PrintWriter out = response.getWriter();
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) {
System.out.println(ex.toString());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]