views:

105

answers:

1

We're running into a serious bug with the Lucene.NET 2.3 codebase. We're upgrading to Lucene 2.9 in hopes the bug is fixed.

Upgrading to the latest version, we see that the MultiFieldQueryParser contructor is [Obsolete]:

[Obsolete("Use the ctor with Version param instead.")]
public MultiFieldQueryParser(string[] fields, Analyzer analyzer)

Instead, we're to use the constructor that takes a Version parameter:

public MultiFieldQueryParser(Version version, string[] fields, Analyzer analyzer)

Problem is, I can't find any documentation regarding what the version parameter is, what it's supposed to be, what I'm supposed to pass in here.

Can anyone shine some light on this?

+5  A: 

The version parameter was added to provide backwards compatibility in a way that can be extended to accommodate future changes.

If you don't care about backwards compatibility, just use Version.LUCENE_CURRENT. If you really need to know exactly what changed, you usually have to go diving into the source code.

General Lucene tip: you usually get better documentation looking at the java version.

itsadok
Thanks a bunch!
Judah Himango
In 3.0.1, Version.LUCENE_CURRENT is deprecated http://lucene.apache.org/java/3_0_1/changes/Changes.html#3.0.1.api_changesSo, use the actual version number.
Shashikant Kore
Are you kidding me? Jeez. Actual version number...ok...Version takes 2 params. A string and an int. Where's the documentation for this?
Judah Himango
Ah, there it is: Lucene.Net.Util.Version.LUCENE_29 as documented here: http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/util/Version.html
Judah Himango
@ShashikantKore Good catch.
itsadok