You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jörg Kiegeland <ki...@ikv.de> on 2007/10/29 18:43:26 UTC

Using Embedded and HTTP Post alternatively

Hi,
I have written code using the Embedded API from SOLR.
Now there is the requirement for access to a remote server, so I would 
need to use HTTP Post.
So is it possible to wrap Embedded API into HTTP Post calls?
If not, how difficult would it be in general to translate the example at 
http://wiki.apache.org/solr/EmbeddedSolr to using HTTP Post (because my 
implementation is based on it)?
Is the example at 
http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/SimplePostTool.java 
the only example for HTTP Post?

Thanks
Jörg


Re: Using Embedded and HTTP Post alternatively

Posted by Mike Klaas <mi...@gmail.com>.
On 6-Nov-07, at 10:52 AM, Jörg Kiegeland wrote:

>
>> If you need to allow HTTP access to solr, then just use standard  
>> solr with your embedded stuff in a custom request handler (or  
>> something). Any other path, you will be re-inventing many wheels.
>>
>> If at all possible, I reccomend checking out:
>> http://wiki.apache.org/solr/Solrj
>>
>> this is nice because you can write the same code and use it in an  
>> embedded context or with an HTTP server depending on the needs (or  
>> if the needs change)
> As I see, the SolrServer interface (and Solrj in general) only is  
> shiped with version 1.3.
>
> Is there any date when Solr 1.3 is published?

No planned date, but I wouldn't expect it to be _too_ long.  It would  
be nice to coincide with Lucene 2.3.

> How reliable are the nightly builds? Can it be used in production?

I think it is quite reliable, but there are bound to be a few quirks  
that haven't been discovered yet.  I'm using it in production.

More important than any claims we make is running it against your own  
application's test suite, of course.

-Mike

Re: Where to set result limit using SolrServer interface?

Posted by Ryan McKinley <ry...@gmail.com>.
Jörg Kiegeland wrote:
> I have a query
> 
>        SolrServer server = getSolrServer();
>        SolrQuery solrQuery = new SolrQuery();
>        solrQuery.setQuery(..);
>        QueryResponse rsp = server.query(solrQuery);
> 
> Now where can I set the result limit for this query?
> 

  solrQuery.setRows( # )

To see the javadocs, download a nightly from:
http://lucene.zones.apache.org:8080/hudson/job/Solr-Nightly/

and it will be in: /docs/api-solrj/

I just realized that these are not on-line like:
http://lucene.zones.apache.org:8080/hudson/job/Solr-Nightly/javadoc/
I'll look into getting that up.


> Another question : Where can I download the test cases for Solrj 
> mentioned in the Solr 1.3 wiki?
> 

They are included in the nightly builds or directly from svn:
http://svn.apache.org/repos/asf/lucene/solr/trunk/client/java/solrj/test/

- - - -

also, when you post messages to the mailing list, start a new thread 
when you ask about a new topic.  See hoss' note:
http://people.apache.org/~hossman/#threadhijack

ryan

Where to set result limit using SolrServer interface?

Posted by Jörg Kiegeland <ki...@ikv.de>.
I have a query

        SolrServer server = getSolrServer();
        SolrQuery solrQuery = new SolrQuery();
        solrQuery.setQuery(..);
        QueryResponse rsp = server.query(solrQuery);

Now where can I set the result limit for this query?

Another question : Where can I download the test cases for Solrj 
mentioned in the Solr 1.3 wiki?

Thanks

Jörg

Re: Using Embedded and HTTP Post alternatively

Posted by Ryan McKinley <ry...@gmail.com>.
> How reliable are the nightly builds? Can it be used in production?
> 

The nightly builds are stable in that they do what they say they do -- 
and if not, they are fixed quickly.  However, the interfaces that have 
changed since 1.2 are not totally stable.  That is, the interfaces from 
1.2 will work in 1.3, but new things (including solrj) are subject to 
change until the official release.

ryan


Re: Using Embedded and HTTP Post alternatively

Posted by Jörg Kiegeland <ki...@ikv.de>.
> If you need to allow HTTP access to solr, then just use standard solr 
> with your embedded stuff in a custom request handler (or something). 
> Any other path, you will be re-inventing many wheels.
>
> If at all possible, I reccomend checking out:
> http://wiki.apache.org/solr/Solrj
>
> this is nice because you can write the same code and use it in an 
> embedded context or with an HTTP server depending on the needs (or if 
> the needs change)
As I see, the SolrServer interface (and Solrj in general) only is shiped 
with version 1.3.

Is there any date when Solr 1.3 is published?

How reliable are the nightly builds? Can it be used in production?

Re: Using Embedded and HTTP Post alternatively

Posted by Ryan McKinley <ry...@gmail.com>.
If you need to allow HTTP access to solr, then just use standard solr 
with your embedded stuff in a custom request handler (or something). 
Any other path, you will be re-inventing many wheels.

If at all possible, I reccomend checking out:
http://wiki.apache.org/solr/Solrj

this is nice because you can write the same code and use it in an 
embedded context or with an HTTP server depending on the needs (or if 
the needs change)

ryan



Jörg Kiegeland wrote:
> Hi,
> I have written code using the Embedded API from SOLR.
> Now there is the requirement for access to a remote server, so I would 
> need to use HTTP Post.
> So is it possible to wrap Embedded API into HTTP Post calls?
> If not, how difficult would it be in general to translate the example at 
> http://wiki.apache.org/solr/EmbeddedSolr to using HTTP Post (because my 
> implementation is based on it)?
> Is the example at 
> http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/SimplePostTool.java 
> the only example for HTTP Post?
> 
> Thanks
> Jörg
> 
>