You don't build an index for a specific version. Rather, much like Codecs, when you create an Analyzer you specify its runtime behavior. With Codecs, that would be Lucene45Codec vs Lucene49Codec. With Analyzers it's FooAnalyzer(Version.45) vs FooAnalyzer(Version.49).
Now imagine that we didn't have this Version, and you created an index with FooAnalyzer(), which (using Hoss's example) does not use an ApostropheFilter. Then in 4.9 this analyzer decides to add this filter into the chain, because somebody thinks it's so useful. You upgrade your Lucene (or Solr) jar and suddenly your app breaks. If you run tests before, maybe you're lucky to hit the inconsistency, you ask the list and Robert tells you "this is Open Source, grab FooAnalyzer from Lucene 4.5 and use it instead of the one we shipped". Fine, I can bite that bullet. Not sure if others want to bite that bullet, but I'm willing to. Because we did document that backwards break in CHANGES, and user should really read CHANGES...
But maybe you're not that lucky, and didn't read CHANGES and suddenly months later you spot the inconsistency (i.e. someone complains about degraded search experience). Now copying FooAnalyzer from 4.5 and shipping that to your customer (or deploy in your app) isn't going to solve the problem, because the index is corrupt. Some documents have the apostrophe indexed, others don't. So you have to rebuild your (or your customer's index). If it's a tiny index, maybe you and I both are willing to bite the bullet. But if it's a HUGE collection, think billions of documents, the kind that takes days or weeks to build ... maybe I won't mind biting the bullet (hey, it's not me who needs to re-index), but I'm pretty positive you won't want to do that. Now you email to the list, pissed off of course, and the only thing we can tell you is "hey, you should have read the fucking CHANGES!!".
Now back to Version, if FooAnalyzer has a ctor which takes a Version then:
- If your app always uses the Version-ctor and passes Version.45, but still your index breaks ... then you could blame the community. You will still need to re-index though.
- If your app always uses the no-Version ctor ... you could only blame yourself for being "adventurous". You will still need to re-index though.
- If your app always uses the Version-ctor, and passes Version.45 and FooAnalyzer behaves well .. then on upgrading to 4.9 you don't hit any inconsistency. Most likely you won't even notice the change, because you don't read the CHANGES (but that's on you, to spot improvements that were added to your precious FooAnalyzer).
If FooAnalyzer exposes two ctors, w/ and w/o a Version, then you can make a decision in your app if you want to care about such things or not. I.e. if your app indexes 100K docs, and you always rebuild the index upon upgrade, cause you anyway do it once and it's so fast that it finishes during your coffee break, then you don't need to worry about Version. Most likely you have a Constants.STUPID_FUCKING_USELESS_VERSION constant somewhere, and all your code uses it, and on upgrade you just modify it from Version.45 to Version.49. But if you index that HUGE collection, and you've been bitten once by such stupidity of not reading CHANGES, then you decide to play it safe and above that Constants constant you probably have a BIG WARNING about DON'T EVER CHANGE THAT WITHOUT READING CHANGES AND RUNNING TESTS!!!.
There is another delicate point raised on the issue – should a FooAnalyzer always offer a Version ctor or not. I.e. if it's its first version (we've just released 4.5 and it's a new analyzer), does it need to expose a Version ctor along w/ a default ctor? Since it doesn't have any back-compat logic, Robert claims it shouldn't because no matter what Version you pass to it, it simply ignores it. Hack, if you pass a Version.41, before it even existed, it might be better if it threw an AreYouSeriousException at your face. But then, if your app uses it in 4.5 and in 4.9 it improves to add the ApostropheFilter, you're screwed (read above). Others (like Uwe and me) think that it always needs to have a Version ctor, alongside a no-Version one, so that if you're the "playing it safe" guy with that scary comment above, then you can pass Version.45 to it, then Version.46/47/48 but on upgrading to 4.9, and you pass Version.49, your app still works as it used to.
About Solr, I don't think it impacts Solr at the moment...