Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lucene.NET - What is the Version parameter in MultiFieldQueryParser constructor?

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?

like image 403
Judah Gabriel Himango Avatar asked Feb 19 '26 05:02

Judah Gabriel Himango


1 Answers

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.

like image 180
itsadok Avatar answered Feb 22 '26 01:02

itsadok



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!