1: Regarding the issue of opening multiple tabs( with titles as respective search text) for different searches:
I have managed to do this, please take a look at:
However, a few bugs which persist are:
- On supplying multi-worded space separated search text, the tabs misbehave and all spaces are converted to "%20" and on reloading "%2520", or the title of the tab simply converts to null. Will deal with this after I have completed a better part of the back-end.
- The search results panel still remains frozen at the first instance created.
2. Design layout of Sigmah SolR configuration xml files ( schema.xml, data-config.xml, solrconfig.xml )
I have worked on this, keeping in mind that I am only indexing important "project" fields from the database for the present.
I have created a core called "Test_Sigmah" for testing the indexing . DataImport succeeds, and Solr Documents are being created successfully, queries are also running fine.
(To test it out on your system locally, download, install and test solr-6.5.0 on your system.
Create a core called Test_Sigmah.
Go to solr-6.5.0/server/solr/Test_Sigmah and in it, paste the contents of the Test_Sigmah zip I have attached here.
Start the solr server, go to the admin UI, select core as Test_Sigmah and do a full import on it. ( Note: The password for my database is hamsig and user is sigmah )
Check if approx 35 documents are generated. You can also query them. )
3. I have been trying to use SolrJ to connect from Sigmah to the standalone Solr Server. Solr runs on port 8983 and Sigmah on localhost:8080 with tomcat.
My aim was to create a service on the client side which would asynchronously communicate with the server-side, where a connection will be made with the Solr server to query it(via SolrJ), and the response will be returned to the client-side in the form of a shared DTO. I have used GWT RPC to achieve this.
I have tested this concept on a standalone GWT project and faced no issues, i.e the SolrDocument query response is rendered as a string and returned to the client-side successfully.
However, when I work with Sigmah using almost the same code, I run into trouble. I get the following error:
at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:617)
at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:279)
at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:268)
at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:160)
at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:942)
at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:957)
at org.sigmah.server.search.SolrSearcher.search(SolrSearcher.java:92)
at org.sigmah.server.search.SearchServiceImpl.search(SearchServiceImpl.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
...
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:515)
... 50 more
I am not able to understand the problem here. Is it because Sigmah is using Guice Filter for all its servlets and does not allow a servlet registered in the following way in web.xml?
<!-- Solr search servlet -->
<servlet>
<servlet-name>SearchServiceImpl</servlet-name>
<servlet-class>
org.sigmah.server.search.SearchServiceImpl
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SearchServiceImpl</servlet-name>
<url-pattern>/sigmah/search</url-pattern>
</servlet-mapping>
If anyone can shed some light on this, I'd be grateful!
-------------------------------------------------------------------------
Next Week:
- Continue working on the Solr config xmls.
-Test the demo database.
-Continue working on solr connection with solrj
-Introduce automatic indexing.
-update installation and upgrade instructions to include installation of Solr
Thank you!