Re: SolrJ and JSON in Solr -1.3

2008-09-15 Thread Ryan McKinley
I also have trouble understanding why you would care how solrj talks  
to the server...  the javabin option is the fastest available.


If you need to give JSON to a client, can't you just put in a proxy?


On Sep 15, 2008, at 12:46 AM, Erik Hatcher wrote:

If the client wants JSON, then it seems passing it straight from  
Solr through the application server tier (hypothetical architecture  
here) to the client as JSON is a nice way to go.  If the client can  
talk directly to Solr, then definitely just wt=json and carry on,  
but more often then not an application server is in the middle.


Curious: SolrJ with javabin format to an app server that converts to  
JSON, pros/cons to the raw response writer?


What are others doing in the Ajaxed client world with Solr?

Erik



On Sep 15, 2008, at 12:01 AM, Jon Baer wrote:

Hmm am I missing something but isn't the real point of SolrJ to be  
able to use the binary (javabin) format to keep it small / tight /  
compressed?  I have had to proxy Solr recently and found just  
throwing a SolrDocumentList as a JSONArray (via json.org libs)  
works pretty well (YMMV).  I was just under the impression that the  
Java to Java bridge was the best way to go ...


It would be nice to have util methods on the SolrDocumentList  
(toJSON(), toXML(), etc) maybe?


- Jon

On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:



On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:

What is the status of JSON support via SolrJ?


Requires a custom ResponseParser.  See SOLR-402 for a couple of  
implementation ideas:


https://issues.apache.org/jira/browse/SOLR-402

Maybe this code is no longer current to trunk?

I want to be able to specify a parser such as the  
XMLResponseParser on my

SolrServer. What are my options?


Use SolrServer#setParser() for one of the above implementations.

I guess I could get an XML response and then convert it to JSON?  
I rather

not.


Ewww, don't do that.

There is a JIRA entry SOLR-402, but real resolution to it per the  
comments

that follow in the feature request.
https://issues.apache.org/jira/browse/SOLR-402


Did the RawResponseParser work for you?   If so, we can build that  
into Solr trunk - +1.  I shoulda done that a while ago, sorry.   
This actually fits well with SOLR-620, in my nefarious plans to  
build a web framework out of Solr ;)


Erik







RE: SolrJ and JSON in Solr -1.3

2008-09-15 Thread Julio Castillo
Jon,
Is the binary (javabin) format implied by selecting the RawResponseParser? I
guess I don't know what the javabin format is.

So you took a SolrDocumentList and converted it into a JSON Array?

Thanks

** julio

-Original Message-
From: Jon Baer [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 14, 2008 9:01 PM
To: solr-user@lucene.apache.org
Subject: Re: SolrJ and JSON in Solr -1.3

Hmm am I missing something but isn't the real point of SolrJ to be able to
use the binary (javabin) format to keep it small / tight / compressed?  I
have had to proxy Solr recently and found just throwing a SolrDocumentList
as a JSONArray (via json.org libs) works pretty well (YMMV).  I was just
under the impression that the Java to Java bridge was the best way to go ...

It would be nice to have util methods on the SolrDocumentList (toJSON(),
toXML(), etc) maybe?

- Jon

On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:


 On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:
 What is the status of JSON support via SolrJ?

 Requires a custom ResponseParser.  See SOLR-402 for a couple of 
 implementation ideas:

  https://issues.apache.org/jira/browse/SOLR-402

 Maybe this code is no longer current to trunk?

 I want to be able to specify a parser such as the XMLResponseParser 
 on my SolrServer. What are my options?

 Use SolrServer#setParser() for one of the above implementations.

 I guess I could get an XML response and then convert it to JSON? I 
 rather not.

 Ewww, don't do that.

 There is a JIRA entry SOLR-402, but real resolution to it per the 
 comments that follow in the feature request.
 https://issues.apache.org/jira/browse/SOLR-402

 Did the RawResponseParser work for you?   If so, we can build that  
 into Solr trunk - +1.  I shoulda done that a while ago, sorry.  This 
 actually fits well with SOLR-620, in my nefarious plans to build a web 
 framework out of Solr ;)

   Erik




RE: SolrJ and JSON in Solr -1.3

2008-09-15 Thread Julio Castillo
Erik,
Yes indeed my architecture has a middle tier and was hoping to use a solrj
client interface to perform the handshake between a Solr server and the
browser.

And so, if I was able to get hold of the response stream already in JSON
format, and just pass it through without having to convert it. Of course if
I could get hold of the XML stream then I could pass it through to the
browser too I suppose.

** julio
 

-Original Message-
From: Erik Hatcher [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 14, 2008 9:46 PM
To: solr-user@lucene.apache.org
Subject: Re: SolrJ and JSON in Solr -1.3

If the client wants JSON, then it seems passing it straight from Solr
through the application server tier (hypothetical architecture here) to the
client as JSON is a nice way to go.  If the client can talk directly to
Solr, then definitely just wt=json and carry on, but more often then not an
application server is in the middle.

Curious: SolrJ with javabin format to an app server that converts to JSON,
pros/cons to the raw response writer?

What are others doing in the Ajaxed client world with Solr?

Erik



On Sep 15, 2008, at 12:01 AM, Jon Baer wrote:

 Hmm am I missing something but isn't the real point of SolrJ to be 
 able to use the binary (javabin) format to keep it small / tight / 
 compressed?  I have had to proxy Solr recently and found just throwing 
 a SolrDocumentList as a JSONArray (via json.org libs) works pretty 
 well (YMMV).  I was just under the impression that the Java to Java 
 bridge was the best way to go ...

 It would be nice to have util methods on the SolrDocumentList 
 (toJSON(), toXML(), etc) maybe?

 - Jon

 On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:


 On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:
 What is the status of JSON support via SolrJ?

 Requires a custom ResponseParser.  See SOLR-402 for a couple of 
 implementation ideas:

 https://issues.apache.org/jira/browse/SOLR-402

 Maybe this code is no longer current to trunk?

 I want to be able to specify a parser such as the XMLResponseParser 
 on my SolrServer. What are my options?

 Use SolrServer#setParser() for one of the above implementations.

 I guess I could get an XML response and then convert it to JSON? I 
 rather not.

 Ewww, don't do that.

 There is a JIRA entry SOLR-402, but real resolution to it per the 
 comments that follow in the feature request.
 https://issues.apache.org/jira/browse/SOLR-402

 Did the RawResponseParser work for you?   If so, we can build that  
 into Solr trunk - +1.  I shoulda done that a while ago, sorry.   
 This actually fits well with SOLR-620, in my nefarious plans to build 
 a web framework out of Solr ;)

  Erik




Re: SolrJ and JSON in Solr -1.3

2008-09-15 Thread Jon Baer
From what I understand you don't have to select a thing, the SolrCore  
would detect SolrJ and do it automatically(?) ...


44. SOLR-486: Binary response format, faster and smaller
than XML and JSON response formats (use wt=javabin).
BinaryResponseParser for utilizing the binary format via SolrJ
and is now the default.
(Noble Paul, yonik)

On Sep 15, 2008, at 2:40 PM, Julio Castillo wrote:


Jon,
Is the binary (javabin) format implied by selecting the  
RawResponseParser? I

guess I don't know what the javabin format is.

So you took a SolrDocumentList and converted it into a JSON Array?

Thanks

** julio

-Original Message-
From: Jon Baer [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 14, 2008 9:01 PM
To: solr-user@lucene.apache.org
Subject: Re: SolrJ and JSON in Solr -1.3

Hmm am I missing something but isn't the real point of SolrJ to be  
able to
use the binary (javabin) format to keep it small / tight /  
compressed?  I
have had to proxy Solr recently and found just throwing a  
SolrDocumentList
as a JSONArray (via json.org libs) works pretty well (YMMV).  I was  
just
under the impression that the Java to Java bridge was the best way  
to go ...


It would be nice to have util methods on the SolrDocumentList  
(toJSON(),

toXML(), etc) maybe?

- Jon

On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:



On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:

What is the status of JSON support via SolrJ?


Requires a custom ResponseParser.  See SOLR-402 for a couple of
implementation ideas:

https://issues.apache.org/jira/browse/SOLR-402

Maybe this code is no longer current to trunk?


I want to be able to specify a parser such as the XMLResponseParser
on my SolrServer. What are my options?


Use SolrServer#setParser() for one of the above implementations.


I guess I could get an XML response and then convert it to JSON? I
rather not.


Ewww, don't do that.


There is a JIRA entry SOLR-402, but real resolution to it per the
comments that follow in the feature request.
https://issues.apache.org/jira/browse/SOLR-402


Did the RawResponseParser work for you?   If so, we can build that
into Solr trunk - +1.  I shoulda done that a while ago, sorry.  This
actually fits well with SOLR-620, in my nefarious plans to build a  
web

framework out of Solr ;)

Erik







Re: SolrJ and JSON in Solr -1.3

2008-09-15 Thread Ryan McKinley
The solrj API does not care how data is passed around, the interface  
to use it is identical.


If you create a CommonsHttpSolrServer and don't set the parser, it  
will by default use the javabin parser.


  SolrServer server = new CommonsHttpSolrServer(url);
  SolrQuery query = new SolrQuery();
  query.setQuery(*:*);
  QueryResponse rsp = server.query(query);
  SolrDocumentList docs = rsp.getResults();

Are you connecting to a 1.2 server?  If not, there is no reason to use  
the XMLResponseParser:

http://wiki.apache.org/solr/Solrj#head-12c26b2d7806432c88b26cf66e236e9bd6e91849

ryan


On Sep 15, 2008, at 11:40 PM, Julio Castillo wrote:


I guess I'm still confused on how to use the Binary response format.
I was looking for examples of SolrJ consumers of the response  
object, but

didn't find anything.
The only example I see listed on the documentation is uses the
XMLResponseParser as follows (excerpt):

CommonHttpSolrServer server = new CommonsHttpSolrServer(url);
Server.setParser(new XMLResponseParser());
SolrQuery query = new SolrQuery();
Query.setQuery(*:*);
QueryResponse rsp = server.query(query);
SolrDocumentList docs = rsp.getResults();

If I use a Binary format instead, do I still use the same steps to  
extract

the data?

thanks

** julio

-Original Message-
From: Jon Baer [mailto:[EMAIL PROTECTED]
Sent: Monday, September 15, 2008 1:11 PM
To: solr-user@lucene.apache.org
Subject: Re: SolrJ and JSON in Solr -1.3

From what I understand you don't have to select a thing, the  
SolrCore would

detect SolrJ and do it automatically(?) ...

44. SOLR-486: Binary response format, faster and smaller
than XML and JSON response formats (use wt=javabin).
BinaryResponseParser for utilizing the binary format via SolrJ
and is now the default.
(Noble Paul, yonik)

On Sep 15, 2008, at 2:40 PM, Julio Castillo wrote:


Jon,
Is the binary (javabin) format implied by selecting the
RawResponseParser? I guess I don't know what the javabin format is.

So you took a SolrDocumentList and converted it into a JSON Array?

Thanks

** julio

-Original Message-
From: Jon Baer [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 14, 2008 9:01 PM
To: solr-user@lucene.apache.org
Subject: Re: SolrJ and JSON in Solr -1.3

Hmm am I missing something but isn't the real point of SolrJ to be
able to use the binary (javabin) format to keep it small / tight /
compressed?  I have had to proxy Solr recently and found just  
throwing

a SolrDocumentList as a JSONArray (via json.org libs) works pretty
well (YMMV).  I was just under the impression that the Java to Java
bridge was the best way to go ...

It would be nice to have util methods on the SolrDocumentList
(toJSON(), toXML(), etc) maybe?

- Jon

On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:



On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:

What is the status of JSON support via SolrJ?


Requires a custom ResponseParser.  See SOLR-402 for a couple of
implementation ideas:

https://issues.apache.org/jira/browse/SOLR-402

Maybe this code is no longer current to trunk?


I want to be able to specify a parser such as the XMLResponseParser
on my SolrServer. What are my options?


Use SolrServer#setParser() for one of the above implementations.


I guess I could get an XML response and then convert it to JSON? I
rather not.


Ewww, don't do that.


There is a JIRA entry SOLR-402, but real resolution to it per the
comments that follow in the feature request.
https://issues.apache.org/jira/browse/SOLR-402


Did the RawResponseParser work for you?   If so, we can build that
into Solr trunk - +1.  I shoulda done that a while ago, sorry.  This
actually fits well with SOLR-620, in my nefarious plans to build a
web framework out of Solr ;)

Erik









Re: SolrJ and JSON in Solr -1.3

2008-09-14 Thread Erik Hatcher


On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:

What is the status of JSON support via SolrJ?


Requires a custom ResponseParser.  See SOLR-402 for a couple of  
implementation ideas:


  https://issues.apache.org/jira/browse/SOLR-402

Maybe this code is no longer current to trunk?

I want to be able to specify a parser such as the XMLResponseParser  
on my

SolrServer. What are my options?


Use SolrServer#setParser() for one of the above implementations.

I guess I could get an XML response and then convert it to JSON? I  
rather

not.


Ewww, don't do that.

There is a JIRA entry SOLR-402, but real resolution to it per the  
comments

that follow in the feature request.
https://issues.apache.org/jira/browse/SOLR-402


Did the RawResponseParser work for you?   If so, we can build that  
into Solr trunk - +1.  I shoulda done that a while ago, sorry.  This  
actually fits well with SOLR-620, in my nefarious plans to build a web  
framework out of Solr ;)


Erik



Re: SolrJ and JSON in Solr -1.3

2008-09-14 Thread Erik Hatcher
If the client wants JSON, then it seems passing it straight from Solr  
through the application server tier (hypothetical architecture here)  
to the client as JSON is a nice way to go.  If the client can talk  
directly to Solr, then definitely just wt=json and carry on, but more  
often then not an application server is in the middle.


Curious: SolrJ with javabin format to an app server that converts to  
JSON, pros/cons to the raw response writer?


What are others doing in the Ajaxed client world with Solr?

Erik



On Sep 15, 2008, at 12:01 AM, Jon Baer wrote:

Hmm am I missing something but isn't the real point of SolrJ to be  
able to use the binary (javabin) format to keep it small / tight /  
compressed?  I have had to proxy Solr recently and found just  
throwing a SolrDocumentList as a JSONArray (via json.org libs) works  
pretty well (YMMV).  I was just under the impression that the Java  
to Java bridge was the best way to go ...


It would be nice to have util methods on the SolrDocumentList  
(toJSON(), toXML(), etc) maybe?


- Jon

On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:



On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:

What is the status of JSON support via SolrJ?


Requires a custom ResponseParser.  See SOLR-402 for a couple of  
implementation ideas:


https://issues.apache.org/jira/browse/SOLR-402

Maybe this code is no longer current to trunk?

I want to be able to specify a parser such as the  
XMLResponseParser on my

SolrServer. What are my options?


Use SolrServer#setParser() for one of the above implementations.

I guess I could get an XML response and then convert it to JSON? I  
rather

not.


Ewww, don't do that.

There is a JIRA entry SOLR-402, but real resolution to it per the  
comments

that follow in the feature request.
https://issues.apache.org/jira/browse/SOLR-402


Did the RawResponseParser work for you?   If so, we can build that  
into Solr trunk - +1.  I shoulda done that a while ago, sorry.   
This actually fits well with SOLR-620, in my nefarious plans to  
build a web framework out of Solr ;)


Erik





Re: SolrJ and JSON in Solr -1.3

2008-09-14 Thread Jon Baer
Hmm am I missing something but isn't the real point of SolrJ to be  
able to use the binary (javabin) format to keep it small / tight /  
compressed?  I have had to proxy Solr recently and found just throwing  
a SolrDocumentList as a JSONArray (via json.org libs) works pretty  
well (YMMV).  I was just under the impression that the Java to Java  
bridge was the best way to go ...


It would be nice to have util methods on the SolrDocumentList  
(toJSON(), toXML(), etc) maybe?


- Jon

On Sep 14, 2008, at 11:14 PM, Erik Hatcher wrote:



On Sep 14, 2008, at 2:51 PM, Julio Castillo wrote:

What is the status of JSON support via SolrJ?


Requires a custom ResponseParser.  See SOLR-402 for a couple of  
implementation ideas:


 https://issues.apache.org/jira/browse/SOLR-402

Maybe this code is no longer current to trunk?

I want to be able to specify a parser such as the XMLResponseParser  
on my

SolrServer. What are my options?


Use SolrServer#setParser() for one of the above implementations.

I guess I could get an XML response and then convert it to JSON? I  
rather

not.


Ewww, don't do that.

There is a JIRA entry SOLR-402, but real resolution to it per the  
comments

that follow in the feature request.
https://issues.apache.org/jira/browse/SOLR-402


Did the RawResponseParser work for you?   If so, we can build that  
into Solr trunk - +1.  I shoulda done that a while ago, sorry.  This  
actually fits well with SOLR-620, in my nefarious plans to build a  
web framework out of Solr ;)


Erik