RE: Solr in Linux Platform

2016-03-14 Thread Adel Mohamed Khalifa
I do that with the hostname ( “ 172.16.0.**:8983/solr/SearchCore “ ) and still 
the problem exist

 

Regards,
Adel Khalifa

 

From: Walter Underwood [mailto:wun...@wunderwood.org] 
Sent: Monday, March 14, 2016 5:36 PM
To: dev@lucene.apache.org
Subject: Re: Solr in Linux Platform

 

Use the hostname of the Ubuntu server instead of “localhost”. This URL will 
only connect to the same host where your client is running: 
localhost:8983/solr/SearchCore

 

wunder

Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)

 

On Mar 14, 2016, at 8:12 AM, Shawn Heisey <apa...@elyograg.org> wrote:

 

On 3/14/2016 8:31 AM, Adel Mohamed Khalifa wrote:



I build a website (Java EE ) and want to search in some json files so
I installed the solr server in an Ubuntu server and create a new core
then indexing json files and the web searched correctly when I moved
my code from windows to the server it stopped and cannot connect to
solr server I try to debug using netbeans in Ubuntu it’s stopped and
there is no exception on this statement (SolrServer server = new
HttpSolrServer(“localhost:8983/solr/SearchCore”) ).



I need for some help Please.



Note :- I attached the servlet I used to search and connect to solr
server.


Don't set the "wt" or "indent" parameters.  You won't be interacting
with the actual text of the response -- all response access with SolrJ
is through Java objects.  Changing wt might just confuse SolrJ -- let it
use its normal binary response format.

The gson/json code you've got probably isn't going to do what you
expect.  If the "wt" parameter did not break the request (which might
happen), then what you get with the getResults method on the response
object will NOT be any standardized format like gson or json.  You will
need to access the SolrDocument object(s) from the SolrDocumentList, and
then access fields from SolrDocument.

Thanks,
Shawn


-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

 



Solr in Linux Platform

2016-03-14 Thread Adel Mohamed Khalifa
Hello everybody,

 

I build a website (Java EE ) and want to search in some json files so I 
installed the solr server in an Ubuntu server and create a new core then 
indexing json files and the web searched correctly when I moved my code from 
windows to the server it stopped and cannot connect to solr server I try to 
debug using netbeans in Ubuntu it’s stopped and there is no exception on this 
statement (SolrServer server = new 
HttpSolrServer(“localhost:8983/solr/SearchCore”) ).

 

I need for some help Please.

 

Note :- I attached the servlet I used to search and connect to solr server.

 

Regards,
Adel Khalifa

 

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", "3");


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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

RE: SolrJ ubuntu Problem

2016-03-13 Thread Adel Mohamed Khalifa
Dear Iker,

Thank you for your interest of my problem.

 

I want to say that when I run my code from windows there’s no problem and I get 
results correctly, but when I run it from Ubuntu server it’s stopped at this 
line ( “  HttpSolrServer server = new 
HttpSolrServer("http://localhost:8983/solr  “). without any exception.

 

Regards,
Adel Khalifa 

 

From: Iker Huerga [mailto:iker.hue...@gmail.com] 
Sent: Sunday, March 13, 2016 2:07 PM
To: dev@lucene.apache.org
Subject: Re: SolrJ ubuntu Problem

 

I would try params.add instead of params.set 

 

Also, are you sure you are getting results back from the server? can you try 
putting a break point in

 

SolrDocumentList results = res.getResults()

 

and see if you are actually getting something back from the server

 

As an alternative, I would tail the solr.log file and check the query that is 
being sent to the server. It might be that the query is not properly formed 
since you are constructing it based on the request parameters.

 

HTH

 

2016-03-13 7:56 GMT-04:00 Adel Mohamed Khalifa <a.moha...@saudisoft.com>:

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:iker.hue...@gmail.com] 
Sent: Sunday, March 13, 2016 1:45 PM


To: dev@lucene.apache.org
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 <a.moha...@saudisoft.com>:

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:image001.gif@01D11A1D.D81CE0C0 |  
<https://twitter.com/Saudisoft> Description: cid:image002.gif@01D11A1D.D81CE0C0 
|  
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0

 

 

From: Iker Huerga [mailto:iker.hue...@gmail.com] 
Sent: Sunday, March 13, 2016 1:33 PM
To: dev@lucene.apache.org
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 <a.moha...@saudisoft.com>:

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:image001.gif@01D11A1D.D81CE0C0 |  
<https://twitter.com/Saudisoft> Description: cid:image002.gif@01D11A1D.D81CE0C0 
|  
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0

 

 





 

-- 

Iker Huerga

http://www.ikerhuerga.com/ 





 

-- 

Iker Huerga

http://www.ikerhuerga.com/ 



-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org





 

-- 

Iker Huerga

http://www.ikerhuerga.com/ 



RE: SolrJ ubuntu Problem

2016-03-13 Thread Adel Mohamed Khalifa
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:iker.hue...@gmail.com] 
Sent: Sunday, March 13, 2016 1:45 PM
To: dev@lucene.apache.org
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 <a.moha...@saudisoft.com>:

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:image001.gif@01D11A1D.D81CE0C0 |  
<https://twitter.com/Saudisoft> Description: cid:image002.gif@01D11A1D.D81CE0C0 
|  
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0

 

 

From: Iker Huerga [mailto:iker.hue...@gmail.com] 
Sent: Sunday, March 13, 2016 1:33 PM
To: dev@lucene.apache.org
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 <a.moha...@saudisoft.com>:

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:image001.gif@01D11A1D.D81CE0C0 |  
<https://twitter.com/Saudisoft> Description: cid:image002.gif@01D11A1D.D81CE0C0 
|  
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0

 

 





 

-- 

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", "3");


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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

RE: SolrJ ubuntu Problem

2016-03-13 Thread Adel Mohamed Khalifa
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 | Fax +2 023 303 2036 | Follow us on  
<https://www.facebook.com/pages/Saudisoft-Co-Ltd/289968997768973?ref_type=bookmark>
 Description: cid:image001.gif@01D11A1D.D81CE0C0 |  
<https://twitter.com/Saudisoft> Description: cid:image002.gif@01D11A1D.D81CE0C0 
|  
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0

 

 

From: Iker Huerga [mailto:iker.hue...@gmail.com] 
Sent: Sunday, March 13, 2016 1:33 PM
To: dev@lucene.apache.org
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 <a.moha...@saudisoft.com>:

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:image001.gif@01D11A1D.D81CE0C0 |  
<https://twitter.com/Saudisoft> Description: cid:image002.gif@01D11A1D.D81CE0C0 
|  
<https://www.linkedin.com/company/77017?trk=vsrp_companies_res_name=VSRPsearchId%3A1489659901402995947155%2CVSRPtargetId%3A77017%2CVSRPcmpt%3Aprimary>
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0

 

 





 

-- 

Iker Huerga

http://www.ikerhuerga.com/ 



SolrJ ubuntu Problem

2016-03-13 Thread Adel Mohamed Khalifa
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 | Fax +2 023 303 2036 | Follow us on
 Description: cid:image001.gif@01D11A1D.D81CE0C0 |
 Description:
cid:image002.gif@01D11A1D.D81CE0C0 |
 Description: cid:image003.gif@01D11A1D.D81CE0C0
Description: cid:image004.jpg@01D11A1D.D81CE0C0