On Tue, Sep 22, 2009 at 11:24 PM, Mark Bennett <mbenn...@ideaeng.com> wrote:
> To do any serious Solr debugging (or filter development) you also need the > Solr source code tree. And you'd like them to be in sync, so that the > Lucene code you see is exactly the same as what was used for the Solr > version you're working with. > > I did find this link on sync'ing the two source tress, for a specific Solr > version. But this seems a bit convoluted, is this really the right answer? > http://happygiraffe.net/blog/2009/07/16/solrs-lucene-source/ > > Generally: > > 1: Given that many threads on the Solr mailing list seem to end with "yeah, > you could write some code to do that", it seems like most developers would > face this problem, and yet I haven't seen it discussed much (at least not > with the search terms I'm using, I keep finding stuff about SolrJ or just > getting the Solr code to build) > > 2: Do most people pick a version of Solr, then try carefully to sync it > with > the exact version of Lucene code, or do they just not worry about the > version stuff unless they get an error? > 3: Or do most Solr/Lucene developers just live out of the Apache nightly > snapshots for both source code trees? And if so, I have a question about > even doing that. (see below) > > Actually, I have had to debug through to Lucene sources only a couple of times till now. I keep both Lucene trunk handy for reference. I rarely need it if I'm writing a Solr plugin. In my IDE I setup Solr trunk with a dependency on Lucene trunk so that I can refer to both sources by ctrl+click on a Lucene class name. It works well because Lucene has excellent back-compat. Before creating a patch, I run tests through ant which uses the bundled Lucene jars. > 4: Getting both projects to live together under Eclipse has seemed a bit > awkward, though again I'd think it's a common task. Any good links on > that? > > I use IDEA now but I did use eclipse earlier and I had set it up the same way. Keep both projects, from Solr remove the dependency on bundled lucene jars, add a dependency on Lucene source for ease in cross-referencing sources. > 5: So do you most of you: > a: Bother with both code trees? (Solr and Lucene) > Yes! > b: Live from the command line with ant? or > Yes! > c: Get them both living under Eclipse? With dependencies back and forth? > I > haven't found a good resource for this yet. > d: Do you also think maven, git and clover are required? > Not really. > 6: Since advanced developers using Nutch and Solr would typically want > Lucene's source code as well, wouldn't it be good to have separate > distribution that includes all of those? Or perhaps there's some "apache > thing" that makes this so trivial it's not worth bothering with? > For most such developers I assume this would be a one-time setup which is used for a long time. Therefore, there is very little advantage in providing a separate distribution I guess. > Back to question 3, just using the nightly trees for both Solr and Lucene, > which presumably are in sync. If you don't need a specific release, this > might be a reasonable workaround, but still a few of the details bother me. > > Get the code: > svn co http://svn.apache.org/repos/asf/lucene/java/trunk lucene-nightly > Checked out revision 817722. > svn co http://svn.apache.org/repos/asf/lucene/solr/trunk solr-nightly > Checked out revision 817722. > > * Note that both are revision 817722 > > Now do builds: > cd lucene-nightly / ant / cd .. > cd solr-nightly / ant / cd .. > > * OK, fine, no clover, I guess I'll live... > > Now check the two Lucene core jar files: > proj $ ls -l lucene-nightly/build/lucene-core-2.9.jar > -rw-r--r-- 1 xyz staff 1104037 Sep 22 09:44 > lucene-nightly/build/lucene-core-2.9.jar > proj $ ls -l solr-nightly/lib/lucene-core-2.9.0.jar > -rw-r--r-- 1 xyz staff 1104049 Sep 22 09:43 > solr-nightly/lib/lucene-core-2.9.0.jar > > * Notice the sizes. They're pretty close, but not identical. The jar in > lucene-nightly was created by my tools, whereas the lucene jar in Solr was > created on another machine. > > Well, trunk changes all the time. If you want exactly the same code, it is best to checkout the Lucene revision mentioned in Solr's CHANGES.txt -- Regards, Shalin Shekhar Mangar.