lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Carvalho Fernandes <mcf2...@gmail.com>
Subject Re: need help to integrate SolrJ with my web application.
Date Wed, 18 Apr 2012 11:18:35 GMT
Hi Vijaya,

Why not just making standard http calls to Solr as it was a RESTful Service?
Just use a HTTP/REST Client on Spring, ask solr to return Json responses
and get rid of all those war dependencies of SolrJ

---
Marcelo

On Monday, April 16, 2012, Ben McCarthy <Ben.McCarthy@tradermedia.co.uk>
wrote:
> Hello,
>
> When I have seen this it usually means the SOLR you are trying to connect
to is not available.
>
> Do you have it installed on:
>
> http://localhost:8080/solr
>
> Try opening that address in your browser.  If your running the example
solr using the embedded Jetty you wont be on 8080 :D
>
> Hope that helps
>
> -----Original Message-----
> From: Vijaya Kumar Tadavarthy [mailto:Vijaya.Tadavarthy@ness.com]
> Sent: 16 April 2012 12:15
> To: 'solr-user@lucene.apache.org'
> Subject: need help to integrate SolrJ with my web application.
>
> Hi All,
>
> I am trying to integrate solr with my Spring application.
>
> I have performed following steps:
>
> 1) Added below list of jars to my webapp lib folder.
> apache-solr-cell-3.5.0.jar
> apache-solr-core-3.5.0.jar
> apache-solr-solrj-3.5.0.jar
> commons-codec-1.5.jar
> commons-httpclient-3.1.jar
> lucene-analyzers-3.5.0.jar
> lucene-core-3.5.0.jar
> 2) I have added Tika jar files for processing binary files.
> tika-core-0.10.jar
> tika-parsers-0.10.jar
> pdfbox-1.6.0.jar
> poi-3.8-beta4.jar
> poi-ooxml-3.8-beta4.jar
> poi-ooxml-schemas-3.8-beta4.jar
> poi-scratchpad-3.8-beta4.jar
> 3) I have modified web.xml added below setup.
> <filter>
>                <filter-name>SolrRequestFilter</filter-name>
>
 <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
>        </filter>
>
>        <filter-mapping>
>                <filter-name>SolrRequestFilter</filter-name>
>                <url-pattern>/dataimport</url-pattern>
>        </filter-mapping>
>        <servlet>
>                <servlet-name>SolrServer</servlet-name>
>
 <servlet-class>org.apache.solr.servlet.SolrServlet</servlet-class>
>                <load-on-startup>1</load-on-startup>
>        </servlet>
>        <servlet>
>                <servlet-name>SolrUpdate</servlet-name>
>
 <servlet-class>org.apache.solr.servlet.SolrUpdateServlet</servlet-class>
>                <load-on-startup>2</load-on-startup>
>        </servlet>
>        <servlet>
>                <servlet-name>Logging</servlet-name>
>
 <servlet-class>org.apache.solr.servlet.LogLevelSelection</servlet-class>
>        </servlet>
>        <servlet-mapping>
>                <servlet-name>SolrUpdate</servlet-name>
>                <url-pattern>/update/*</url-pattern>
>        </servlet-mapping>
>        <servlet-mapping>
>                <servlet-name>Logging</servlet-name>
>                <url-pattern>/admin/logging</url-pattern>
>        </servlet-mapping>
>
> I am trying to test this setup by running a simple java program with
extract content of MS Excel file as below
>
> public SolrServer createNewSolrServer()
>        {
>          try {
>            // setup the server...
>            String url = "http://localhost:8080/solr";
>            CommonsHttpSolrServer s = new CommonsHttpSolrServer( url );
>            s.setConnectionTimeout(100); // 1/10th sec
>            s.setDefaultMaxConnectionsPerHost(100);
>            s.setMaxTotalConnections(100);
>
>            // where the magic happens
>            s.setParser(new BinaryResponseParser());
>            s.setRequestWrit________________________________________
>
>
> This e-mail is sent on behalf of Trader Media Group Limited, Registered
Office: Auto Trader House, Cutbush Park Industrial Estate, Danehill, Lower
Earley, Reading, Berkshire, RG6 4UT(Registered in England No. 4768833).
This email and any files transmitted with it are confidential and may be
legally privileged, and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email in error
please notify the sender. This email message has been swept for the
presence of computer viruses.
>
>

-- 
----
Marcelo Carvalho Fernandes
+55 21 8272-7970
+55 21 2205-2786

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