File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
Nest/Domain/Mapping/Types
Tests/Nest.Tests.Unit/Reproduce Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ public class MultiFieldMapping : IElasticType
1010 {
1111 private readonly TypeNameMarker _defaultType ;
1212
13- public MultiFieldMapping ( )
14- : this ( "multi_field" )
13+ public MultiFieldMapping ( )
1514 {
1615 this . Fields = new Dictionary < PropertyNameMarker , IElasticCoreType > ( ) ;
16+ _defaultType = "multi_field" ;
1717 }
1818
19- protected MultiFieldMapping ( TypeNameMarker defaultType )
19+ protected MultiFieldMapping ( TypeNameMarker defaultType ) : this ( )
2020 {
2121 _defaultType = defaultType ;
2222 }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Reflection ;
5+ using Elasticsearch . Net ;
6+ using Nest . Tests . MockData . Domain ;
7+ using NUnit . Framework ;
8+
9+ namespace Nest . Tests . Unit . Reproduce
10+ {
11+ /// <summary>
12+ /// tests to reproduce reported errors
13+ /// </summary>
14+ [ TestFixture ]
15+ public class Reproduce990Tests : BaseJsonTests
16+ {
17+ [ Test ]
18+ public void DateMappingShouldNotTrow ( )
19+ {
20+ Assert . DoesNotThrow ( ( ) =>
21+ {
22+ var result = _client . Map < ElasticsearchProject > ( p => p
23+ . DynamicTemplates ( d => d
24+ . Add ( dt => dt
25+ . Name ( "date_template" )
26+ . Match ( "*_date" )
27+ . MatchMappingType ( "date" )
28+ . Mapping ( mp => mp
29+ . Date ( date => date
30+ . Format ( "basic_date || date|| yyyy/MM/dd || dd/MM/yyyy || dd-MM-yyyy || MM/dd/yyyy || MM-dd-yyyy" )
31+ . Fields ( f => f
32+ . String ( fs => fs
33+ . Name ( "raw" )
34+ . Analyzer ( "number_delimiter" )
35+ )
36+ )
37+ )
38+ )
39+ )
40+ )
41+ ) ;
42+ } ) ;
43+ }
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments