lucene.net

Where is FloatField?


I've added Lucene.Net to a .Net 6 Core project and indexing docs with TextField, StringFiled, and Int32Field all work fine but FloatField doesn't seem to be supported. I'm using LuceneVersion.LUCENE_48. According to https://lucene.apache.org/core/4_1_0/core/org/apache/lucene/document/FloatField.html, FloatField has been available since version 4.1 of Java Lucene. What am I missing? Thanksenter image description here


Solution

  • See the Lucene.NET 4.8.0 migration guide. Numeric types and method names including numeric types have been changed to use .NET conventions.

    Instead of Float use Single. Note that Lucene.Net.Queries.Function.ValueSources.SingleFunction was renamed Lucene.Net.Queries.Function.ValueSources.SingularFunction to distinguish it from the System.Single data type.

    So, FloatField has been renamed to SingleField.