3
votes

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?

1

1 Answers

6
votes

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.