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 Tim Terlegård <ti...@gmail.com> on 2010/03/18 13:15:01 UTC
solrj sends duplicate documents
I'm using StreamingUpdateSolrServer to index a document.
StreamingUpdateSolrServer server = new
StreamingUpdateSolrServer("http://localhost:8983/solr/core0", 20, 4);
server.setRequestWriter(new BinaryRequestWriter());
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", "12121212");
doc.addField("text", "something");
server.add(doc);
server.commit();
When I use Wireshark I can see that two documents are sent. I see that
this happens:
1) POST /solr/core0/update HTTP/1.1
2) <stream><add><doc> ... </stream>
3) POST /solr/core0/update/javabin HTTP/1.1
4) ...
In the log file I see this:
2010-mar-18 12:53:46 org.apache.solr.core.SolrCore execute
INFO: [core0] webapp=/solr path=/update params={} status=0 QTime=7
...
2010-mar-18 12:53:46 org.apache.solr.core.SolrCore execute
INFO: [core0] webapp=/solr path=/update/javabin
params={waitSearcher=true&waitFlush=true&wt=javabin&commit=true&version=1}
status=0 QTime=24
It looks like server.add() sends the document in clear text and then
server.commit() also sends it in the javabin format. I'd rather it
just sends one document and in the javabin format. Am I using solrj
inappropriately? This is 1.4.
/Tim
Re: solrj sends duplicate documents
Posted by Tim Terlegård <ti...@gmail.com>.
It would be nice if the documentation mentioned this. :)
/Tim
2010/3/18 Erik Hatcher <er...@gmail.com>:
> The StreamingUpdateSolrServer does not support binary format, unfortunately.
>
> Erik
>
> On Mar 18, 2010, at 8:15 AM, Tim Terlegård wrote:
>
>> I'm using StreamingUpdateSolrServer to index a document.
>>
>> StreamingUpdateSolrServer server = new
>> StreamingUpdateSolrServer("http://localhost:8983/solr/core0", 20, 4);
>> server.setRequestWriter(new BinaryRequestWriter());
>> SolrInputDocument doc = new SolrInputDocument();
>> doc.addField("id", "12121212");
>> doc.addField("text", "something");
>> server.add(doc);
>> server.commit();
>>
>> When I use Wireshark I can see that two documents are sent. I see that
>> this happens:
>>
>> 1) POST /solr/core0/update HTTP/1.1
>> 2) <stream><add><doc> ... </stream>
>> 3) POST /solr/core0/update/javabin HTTP/1.1
>> 4) ...
>>
>> In the log file I see this:
>> 2010-mar-18 12:53:46 org.apache.solr.core.SolrCore execute
>> INFO: [core0] webapp=/solr path=/update params={} status=0 QTime=7
>> ...
>> 2010-mar-18 12:53:46 org.apache.solr.core.SolrCore execute
>> INFO: [core0] webapp=/solr path=/update/javabin
>> params={waitSearcher=true&waitFlush=true&wt=javabin&commit=true&version=1}
>> status=0 QTime=24
>>
>> It looks like server.add() sends the document in clear text and then
>> server.commit() also sends it in the javabin format. I'd rather it
>> just sends one document and in the javabin format. Am I using solrj
>> inappropriately? This is 1.4.
>>
>> /Tim
>
>
Re: solrj sends duplicate documents
Posted by Erik Hatcher <er...@gmail.com>.
The StreamingUpdateSolrServer does not support binary format,
unfortunately.
Erik
On Mar 18, 2010, at 8:15 AM, Tim Terlegård wrote:
> I'm using StreamingUpdateSolrServer to index a document.
>
> StreamingUpdateSolrServer server = new
> StreamingUpdateSolrServer("http://localhost:8983/solr/core0", 20, 4);
> server.setRequestWriter(new BinaryRequestWriter());
> SolrInputDocument doc = new SolrInputDocument();
> doc.addField("id", "12121212");
> doc.addField("text", "something");
> server.add(doc);
> server.commit();
>
> When I use Wireshark I can see that two documents are sent. I see that
> this happens:
>
> 1) POST /solr/core0/update HTTP/1.1
> 2) <stream><add><doc> ... </stream>
> 3) POST /solr/core0/update/javabin HTTP/1.1
> 4) ...
>
> In the log file I see this:
> 2010-mar-18 12:53:46 org.apache.solr.core.SolrCore execute
> INFO: [core0] webapp=/solr path=/update params={} status=0 QTime=7
> ...
> 2010-mar-18 12:53:46 org.apache.solr.core.SolrCore execute
> INFO: [core0] webapp=/solr path=/update/javabin
> params
> ={waitSearcher=true&waitFlush=true&wt=javabin&commit=true&version=1}
> status=0 QTime=24
>
> It looks like server.add() sends the document in clear text and then
> server.commit() also sends it in the javabin format. I'd rather it
> just sends one document and in the javabin format. Am I using solrj
> inappropriately? This is 1.4.
>
> /Tim