I am not indexing to same index. I have two methods which adds doc by calling server.addBeans(list) twice. (2 different lists obtained from DB).
Now I call server.query("some query1") and obtain result. Then from this I create query based on first result and call server.query("some query2"); -----Original Message----- From: Aleksander M. Stensby [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2008 4:22 PM To: solr-user@lucene.apache.org Subject: Re: Unique id Ok, but how do you map your table structure to the index? As far as I can understand, the two tables have different structre, so why/how do you map two different datastructures onto a single index? Are the two tables connected in some way? If so, you could make your index structure reflect the union of both tables and just make one insertion into the index per entry of the two tables. Maybe you could post the table structure so that I can get a better understanding of your use-case... - Aleks On Wed, 19 Nov 2008 11:25:56 +0100, Raghunandan Rao <[EMAIL PROTECTED]> wrote: > Ok got it. > I am indexing two tables differently. I am using Solrj to index with > @Field annotation. I make two queries initially and fetch the data from > two tables and index them separately. But what if the ids in two tables > are same? That means documents with same id will be deleted when doing > update. > > How does this work? Please explain. > > Thanks. > > -----Original Message----- > From: Aleksander M. Stensby [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 19, 2008 3:49 PM > To: solr-user@lucene.apache.org > Subject: Re: Unique id > > Yes it is. You need a unique id because the add method works as and "add > > or update" method. When adding a document whose ID is already found in > the > index, the old document will be deleted and the new will be added. Are > you > indexing two tables into the same index? Or does one entry in the index > > consist of data from both tables? How are these linked together without > an > ID? > > - Aleksander > > On Wed, 19 Nov 2008 10:42:00 +0100, Raghunandan Rao > <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> Is the uniqueKey in schema.xml really required? >> >> >> Reason is, I am indexing two tables and I have id as unique key in >> schema.xml but id field is not there in one of the tables and indexing >> fails. Do I really require this unique field for Solr to index it > better >> or can I do away with this? >> >> >> Thanks, >> >> Rahgu >> > >