I am giving you a detailed sample of my spring usage.

<bean id="solrHttpClient" class="org.apache.commons.httpclient.HttpClient">
    <property name="httpConnectionManager">
        <bean
class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager">
            <property name="maxConnectionsPerHost" value="10"/>
            <property name="maxTotalConnections" value="10"/>
        </bean>
    </property>
</bean>

<bean id="mySearchImpl" class="com.me.search.MySearchSolrImpl">
    <property name="core1">
        <bean
class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
            <constructor-arg value="http://localhost/solr/core1"/>
            <constructor-arg ref="solrHttpClient"/>
        </bean>
    </property>
    <property name="core2">
        <bean
class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
            <constructor-arg value="http://localhost/solr/core2"/>
            <constructor-arg ref="solrHttpClient"/>
        </bean>
    </property>
</bean>

Hope this helps.

Cheers
Avlesh

On Sat, May 9, 2009 at 12:39 AM, sachin78 <tendulkarsachi...@gmail.com>wrote:

>
> Ranjeeth,
>
>    Did you figured aout how to do this? If yes, can you share with me how
> you did it? Example bean definition in xml will be helpful.
>
> --Sachin
>
>
> Funtick wrote:
> >
> > Use constructor and pass URL parameter. Nothing SPRING related...
> >
> > Create a Spring bean with attributes 'MySolr', 'MySolrUrl', and 'init'
> > method... 'init' will create instance of CommonsHttpSolrServer. Configure
> > Spring...
> >
> >
> >
> >> I am using Solr 1.3 and Solrj as a Java Client. I am
> >> Integarating Solrj in Spring framwork, I am facing a problem,
> >> Spring framework is not inializing CommonsHttpSolrServer
> >> class, how can  I define this class to get the instance of
> >> SolrServer to invoke furthur method on this.
> >>
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Initialising-of-CommonsHttpSolrServer-in-Spring-framwork-tp18808743p23451795.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Reply via email to