Sounds good, especially because your old scenario was fragile. The doc IDs in your first core could change as a result of a single doc deletion and optimize. So the doc IDs stored in the second core would then be wrong...
Your user-defined unique key is definitely a better way to go. There are some tricks you could try if there are performance issues.... Best Erick On Thu, Dec 2, 2010 at 7:47 AM, Lohrenz, Steven <steven.lohr...@hmhpub.com>wrote: > I know the doc ids from one core have nothing to do with the other. I was > going to use the docId returned from the first core in the solr results and > store it in the second core that way the second core knows about the doc ids > from the first core. So when you query the second core from the Filter in > the first core you get returned a set of data that includes the docId from > the first core that the document relates to. > > I have backed off from this approach and have a user defined primary key in > the firstCore, which is stored as the reference in the secondCore and when > the filter performs the search it goes off and queries the firstCore for > each primary key and gets the lucene docId from the returned doc. > > Thanks, > Steve > > -----Original Message----- > From: Erick Erickson [mailto:erickerick...@gmail.com] > Sent: 02 December 2010 02:19 > To: solr-user@lucene.apache.org > Subject: Re: Return Lucene DocId in Solr Results > > On the face of it, this doesn't make sense, so perhaps you can explain a > bit.The doc IDs > from one Solr instance have no relation to the doc IDs from another Solr > instance. So anything > that uses doc IDs from one Solr instance to create a filter on another > instance doesn't seem > to be something you'd want to do... > > Which may just mean I don't understand what you're trying to do. Can you > back up a bit > and describe the higher-level problem? This seems like it may be an XY > problem, see: > http://people.apache.org/~hossman/#xyproblem > > Best > Erick > > On Tue, Nov 30, 2010 at 6:57 AM, Lohrenz, Steven > <steven.lohr...@hmhpub.com>wrote: > > > Hi, > > > > I was wondering how I would go about getting the lucene docid included in > > the results from a solr query? > > > > I've built a QueryParser to query another solr instance and and join the > > results of the two instances through the use of a Filter. The Filter > needs > > the lucene docid to work. This is the only bit I'm missing right now. > > > > Thanks, > > Steve > > > > >