List Info

Thread: uniqueKey type




uniqueKey type
user name
2007-11-06 16:31:31
We used a custom fieldType that segments the values of a
field A into
tokens.  We then define uniqueKey as that field A.  It seems
when we update
a document by solr, documents that have different values
(one contains the
other as a substring)  gets collided into one so the result
is the new
document removed the old one.

Does uniqueKey field has to be string typed?  How does the
comparison of the
values work for updating documents?


thanks,

-Hui
Re: uniqueKey type
country flaguser name
Canada
2007-11-06 16:36:10
On 6-Nov-07, at 2:31 PM, Yu-Hui Jin wrote:

> We used a custom fieldType that segments the values of
a field A into
> tokens.  We then define uniqueKey as that field A.  It
seems when  
> we update
> a document by solr, documents that have different
values (one  
> contains the
> other as a substring)  gets collided into one so the
result is the new
> document removed the old one.
>
> Does uniqueKey field has to be string typed?  How does
the  
> comparison of the
> values work for updating documents?

uniqueKey needn't be string type, but the tokenizer must
produce a  
single token only (and any documents that have the same
resulting  
token will be considered "the same").

If this is violated, the behaviour is undefined (but I
wouldn't be  
surprised if the first token was used).

-Mike


Re: uniqueKey type
user name
2007-11-06 16:49:24
Got it. Thanks, Mike.  That explains.


regards,

-Hui


On 11/6/07, Mike Klaas <mike.klaasgmail.com> wrote:
>
> On 6-Nov-07, at 2:31 PM, Yu-Hui Jin wrote:
>
> > We used a custom fieldType that segments the
values of a field A into
> > tokens.  We then define uniqueKey as that field A.
 It seems when
> > we update
> > a document by solr, documents that have different
values (one
> > contains the
> > other as a substring)  gets collided into one so
the result is the new
> > document removed the old one.
> >
> > Does uniqueKey field has to be string typed?  How
does the
> > comparison of the
> > values work for updating documents?
>
> uniqueKey needn't be string type, but the tokenizer
must produce a
> single token only (and any documents that have the same
resulting
> token will be considered "the same").
>
> If this is violated, the behaviour is undefined (but I
wouldn't be
> surprised if the first token was used).
>
> -Mike
>
>


-- 
Regards,

-Hui
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )