From dbb9b809a9b476c377b543d421b01f36a5afd7fa Mon Sep 17 00:00:00 2001 From: Markus Cozowicz Date: Thu, 14 Sep 2017 07:29:53 -0400 Subject: [PATCH] fix feature serialization --- Crawl/Crawl/HtmlExtractor.cs | 4 ++-- Crawl/Data/CrawlResponse.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Crawl/Crawl/HtmlExtractor.cs b/Crawl/Crawl/HtmlExtractor.cs index 971e1f22..329fa285 100644 --- a/Crawl/Crawl/HtmlExtractor.cs +++ b/Crawl/Crawl/HtmlExtractor.cs @@ -187,7 +187,7 @@ namespace Microsoft.DecisionService.Crawl if (!string.IsNullOrEmpty(keywords)) { response.Keywords = keywords.Split(',').Select(k => WebUtility.HtmlDecode(k.Trim())).ToList(); - response.Features = JsonConvert.SerializeObject( + response.Features = new HtmlFeatures { Keywords = new HtmlKeywordFeatures @@ -195,7 +195,7 @@ namespace Microsoft.DecisionService.Crawl // make sure individual keywords are represented as individual VW features Keywords = string.Join(" ", response.Keywords.Select(k => k.Replace(' ', '_'))) } - }); + }; } // build article diff --git a/Crawl/Data/CrawlResponse.cs b/Crawl/Data/CrawlResponse.cs index ac063bea..0f0c66d4 100644 --- a/Crawl/Data/CrawlResponse.cs +++ b/Crawl/Data/CrawlResponse.cs @@ -54,6 +54,6 @@ namespace Microsoft.DecisionService.Crawl.Data public string Video { get; set; } [JsonProperty("features", NullValueHandling = NullValueHandling.Ignore)] - public string Features { get; set; } + public object Features { get; set; } } }