Make sure you're clear on the concepts though. "Unique ID" is kind of fuzzy.
Unique Key is a field YOU define in your schema. This will cause SOLR to
overwrite any document already in the index with a particular unique key
when
another document is added. Examples would be, say, "inventory_number" or
"part_number" or...

Docment IDs, on the other hand, are assigned internally by SOLR/Lucene and,
by definition, there will never be duplicates.

To confuse the issue a bit more, as Lance points out it's possible to have
SOLR
generate unique keys for you (completely separate from document IDs), but
I'd
advise against this until you know exactly what that'll do. You haven't told
us
what problem you're trying to solve though, so it's hard to really recommend
anything with confidence...

Best
Erick

On Sat, Aug 21, 2010 at 2:22 PM, Lance Norskog <goks...@gmail.com> wrote:

> This will make a unique key for you:
>
> In <types>
>    <fieldType name="uuid" class="solr.UUIDField" indexed="true" />
> ........................
> In <fields>
>  <field name="id" type="uuid" indexed="true" stored="true" default="NEW"/>
>
>
> 2010/8/21 Rafał Kuć <ra...@alud.com.pl>:
> > Hello!
> >
> >> is there need to allot a unique id to every file?
> >
> > You don`t need one, unique id is not mandatory, but many features wont
> > work without it.
> >
> >> do we have to specify the id manually or solr does it?
> >
> > Solr doesn`t do it automatically, You have to do it.
> >
> >> how to allot an unique id to text file?
> >
> > Just generate an id in your application and pass it to ie. xml file.
> >
> > If you have some questions about uniqe id, this page should be a place
> > for You http://wiki.apache.org/solr/UniqueKey
> >
> > --
> > Regards,
> >  Rafał Kuć
> >
> >
>
>
>
> --
> Lance Norskog
> goks...@gmail.com
>

Reply via email to