You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem including expected versus actual behavior:
Using the fluent index mapping, the Keyword method signature that accepts a lambda (Expression<Func<TDocument, object>>) will throw an error on a list of strings.
Error:
Elastic.Transport.UnexpectedTransportException: 'Sequence contains no elements'
Steps to reproduce:
Using this test class:
public class TestDoc
{
public IList<string> Tags { get; set; } = new List<string>();
}
Attempt to create an index:
var r = await Client.Indices.CreateAsync<TestDoc>("testdoc", c => c
.Mappings(m => m
.Properties(p => p
.Text(t => t.Tags, c => c
.Fields(f => f
.Keyword(kk => kk, cc => cc
.IgnoreAbove(256)
)
)
)
)
)
);
Expected behavior
Should produce this mapping without error:
Elastic.Clients.Elasticsearch version: 8.13.5
Elasticsearch version: 8.13.0
.NET runtime version: net6.0
Operating system version: win11
Description of the problem including expected versus actual behavior:
Using the fluent index mapping, the Keyword method signature that accepts a lambda (Expression<Func<TDocument, object>>) will throw an error on a list of strings.
Error:
Steps to reproduce:
Using this test class:
Attempt to create an index:
Expected behavior
Should produce this mapping without error:
Original question asked in the Elastic forum: Creating index for list of strings
Workaround:
The text was updated successfully, but these errors were encountered: