Skip to content

Commit e6734d7

Browse files
committed
Constructor initialization for collections in termvector response objects
1 parent c45bfa1 commit e6734d7

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/Nest/Domain/Responses/MultiTermVectorResponse.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class MultiTermVectorResponse : BaseResponse, IMultiTermVectorResponse
1717
public MultiTermVectorResponse()
1818
{
1919
IsValid = true;
20+
Documents = new List<TermVectorResponse>();
2021
}
2122

2223
[JsonProperty("docs")]

src/Nest/Domain/Responses/TermVectorResponse.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class TermVectorResponse : BaseResponse, ITermVectorResponse
1818
public TermVectorResponse()
1919
{
2020
IsValid = true;
21+
TermVectors = new Dictionary<string, TermVector>();
2122
}
2223

2324
[JsonProperty("found")]

src/Nest/Domain/TermVector/TermVector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace Nest
99
[JsonObject]
1010
public class TermVector
1111
{
12+
public TermVector()
13+
{
14+
Terms = new Dictionary<string, TermVectorTerm>();
15+
}
16+
1217
[JsonProperty("field_statistics")]
1318
public FieldStatistics FieldStatistics { get; internal set; }
1419

src/Nest/Domain/TermVector/TermVectorTerm.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace Nest
99
[JsonObject]
1010
public class TermVectorTerm
1111
{
12+
public TermVectorTerm()
13+
{
14+
Tokens = new List<Token>();
15+
}
16+
1217
[JsonProperty("doc_freq")]
1318
public int DocumentFrequency { get; internal set; }
1419

0 commit comments

Comments
 (0)