Skip to content

Commit b2ad5dd

Browse files
authored
Merge pull request #2193 from HarveyWilliams/bug/2176
"collate_match" for phrase suggestions
2 parents 04638f2 + d6bfb64 commit b2ad5dd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Nest/Search/Suggesters/SuggestOption.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ internal SuggestOption(JObject payload, JsonSerializer serializer)
3131
[JsonProperty("highlighted")]
3232
public string Highlighted { get; internal set; }
3333

34-
public T Payload<T>(JsonSerializer serializer = null)
34+
[JsonProperty("collate_match")]
35+
public bool CollateMatch { get; internal set; }
36+
37+
public T Payload<T>(JsonSerializer serializer = null)
3538
where T : class
3639
{
3740
if (_payload == null) return null;
@@ -61,7 +64,9 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
6164
option.Score = (double)properties["score"];
6265
if (properties.ContainsKey("text"))
6366
option.Text = (string)properties["text"];
64-
return option;
67+
if (properties.ContainsKey("collate_match"))
68+
option.CollateMatch = (bool)properties["collate_match"];
69+
return option;
6570
}
6671

6772
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

0 commit comments

Comments
 (0)