Hi Joey, if what you want is to customize Solr so that you do the indexing
code on the server side, you could implement your own RequestHandler, then
the only thing you need to do is to add it to the solrconfig.xml and you
can call it through http GET method.

On Tue, Dec 13, 2011 at 4:42 PM, Schmidt Jeff <j...@rvswithoutborders.com>wrote:

> Joey:
>
> I'm not sure what you mean by wapping solr to your own web application.
>  There is a way to embed Solr into your application (same JVM), but I've
> never used that.  If you're talking about your servlet running in one JVM
> and Solr in another, then use the SolrJ client library to interact with
> Solr.  I use CommonsHttpSolrServer (
> http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/impl/CommonsHttpSolrServer.html)
> and specify the URL that locates the Solr server/core name.
>
> I use Spring to instantiate the server instance, and then I inject it
> where I need it.
>
>        <bean id="solrServerIngContent"
> class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
>                <constructor-arg value="
> http://localhost:8091/solr/mycorename"/>
>        </bean>
>
> Thus is equivalent to new CommonsHttpSolrServer("
> http://localhost:8091/solr/mycorename";);
>
> Check out the API link above and http://wiki.apache.org/solr/Solrj to
> examples on using the SolrJ API.
>
> Cheers,
>
> Jeff
>
> On Dec 13, 2011, at 12:12 PM, Joey wrote:
>
> > Hi I am new to Solr and want to do some customize development.
> > I have wrapped solr to my own web application, and want to write a
> servlet
> > to index a file system.
> >
> > The question is how can I get SolrServer inside my Servlet?
> >
> > --
> > View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-get-SolrServer-tp3583304p3583304.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Reply via email to