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 zqzuk <zi...@hotmail.com> on 2008/01/21 22:18:10 UTC

Is it possible to have "append" kind update operation?

Hi, is it possible to have "append" like updates, where if two records of
same id's are posted to solr, the contents of the two merges and composes a
single record with the id? I am asking because my program works in a
multi-thread manner where several threads produces serveral parts of a final
record which is to be posted and indexed. Currently I am having a
preprocessing program where the threads produces parts, then a post
processing where the parts are merged into a single xml file then posted to
solr. If it is possible to do "append" like updating, then each thread can
post to solr directly without writing temporary files.

For example, thread 1 produce an xml file like:
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<add allowDups="true" overwriteCommitted="false" overwritePending="false">
<doc>
<field name="record-id">198</field>
<field name="description">This is my short text. This is part 1 of the
record with id=198</field>
</doc>
</add>
--------------------------------------------------

thread 2 produces xml like

--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<add allowDups="true" overwriteCommitted="false" overwritePending="false">
<doc>
<field name="record-id">198</field>
<field name="title">Title here. This is part 2 of record with id=198</field>
</doc>
</add>
--------------------------------------------------

Currently my program needs to produce the two separate files, then merge
them into

--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<add allowDups="true" overwriteCommitted="false" overwritePending="false">
<doc>
<field name="record-id">198</field>
<field name="description">This is my short text. This is part 1 of the
record with id=198</field>
<field name="description">This is my short text. This is part 1 of the
record with id=198</field>
</doc>
</add>
--------------------------------------------------
 
Then post the final file. If I post the two separately, I get two separate
records with same id=198, while one has only field "description" and the
other has only field "title".

Is it possible to append? Or is my settings "allowDup" incorrect?

Many thanks!
-- 
View this message in context: http://www.nabble.com/Is-it-possible-to-have-%22append%22-kind-update-operation--tp15006743p15006743.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Is it possible to have "append" kind update operation?

Posted by Chris Hostetter <ho...@fucit.org>.
: Hi, is it possible to have "append" like updates, where if two records of

there is an open Jira issue to deal with the notion of "updating" docs in 
place, but i think the people who were working on it the most have put it 
somewhat on hold to focus more on the MultiCore and distributed search 
stuff...

	http://issues.apache.org/jira/browse/SOLR-139


FWIW: even if that issue was resovled and commited, i don't know that i 
wouldd use it in your use case ... the goal there is to allow people to 
modify Solr docs by requiring that everything be stored (which 
increases index size in most cases) ... your problem description doesn't 
suggest that you really need to "modify" documents long after they have 
been indexed, just that you wnat to split up some of the data 
fetching/preperation before indexing the documents -- this seems like a 
simple enough client side issue.  building up your data objects in 
parallel threads, merging them and then indexing them seems likethe most 
straightforward approach to your problem.


-Hoss