On 6 July 2013 09:45, Ali, Saqib <docbook....@gmail.com> wrote: > Thanks Jason! That was very helpful. > > I read on the solr wiki that: > "Documents must have a unique key and the unique key must be stored > (stored="true" in schema.xml)" > > What is this unique key? Is this just a id that we define in the schema.xml > that is unique to all documents? We have something as follows: > <field name="id" type="long" indexed="true" stored="true"/> > > Will this suffice?
By default, schema.xml should also have <uniqueKey>id</uniqueKey> and with these, you should be all set as far as the configuration goes. At index time, you also have to provide this unique key to Solr, and for distributed search, ensure that it is unique across all shards, as the Wiki notes. How you form this unique key depends on your use case, but for example, you could use the system filepath, or a MD5 sum of the file contents. Regards, Gora