Does NEST [Keyword] attribute's NullValue parameter not work?

Hi,

I use NEST with C#. I want to index objects of my class annotated with the keyword attribute's NullValue param with auto-mapping in hope that when the field's value is null, instead of nothing being indexed for it, we can have it with a substitute value in the index. Here is the C# code snippet:

public class MyClass
{
    [Keyword]
    public string ID { get; set;}

    [Keyword(NullValue = "null")]
    public string CustomerID { get; set; }

    [Keyword(NullValue = "_null_")]
    public string OrderID { get; set; }
}

However, neither CustomerID nor OrderID are indexed when they are null, even though I can verify "null_value": "null" or "null_value": "null" is in the query DSL that NEST generates for them. I use NEST 6.6.0.

Does the NEST Keyword attribute's NullValue work? If so, what should I do differently to make it work?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.