File tree 2 files changed +48
-3
lines changed
Nest/Domain/Mapping/Types
Tests/Nest.Tests.Unit/Reproduce
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
10
10
{
11
11
private readonly TypeNameMarker _defaultType ;
12
12
13
- public MultiFieldMapping ( )
14
- : this ( "multi_field" )
13
+ public MultiFieldMapping ( )
15
14
{
16
15
this . Fields = new Dictionary < PropertyNameMarker , IElasticCoreType > ( ) ;
16
+ _defaultType = "multi_field" ;
17
17
}
18
18
19
- protected MultiFieldMapping ( TypeNameMarker defaultType )
19
+ protected MultiFieldMapping ( TypeNameMarker defaultType ) : this ( )
20
20
{
21
21
_defaultType = defaultType ;
22
22
}
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