public void ParseMlthMatch() { var innerParser = new MoreLikeThisHandlerMatchResponseParser <TestDocWithGuid>(GetDocumentParser <TestDocWithGuid>()); var parser = new SolrMoreLikeThisHandlerQueryResultsParser <TestDocWithGuid>(new[] { innerParser }); var response = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithInterestingTermsDetails.xml"); var results = parser.Parse(response); Assert.IsNotNull(results); Assert.IsNotNull(results.Match); Assert.AreEqual(new Guid("224fbdc1-12df-4520-9fbe-dd91f916eba1"), results.Match.Key); }
public void ParseInterestingTermsDetails() { var innerParser = new InterestingTermsResponseParser <Product>(); var parser = new SolrMoreLikeThisHandlerQueryResultsParser <Product>(new[] { innerParser }); var response = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithInterestingTermsDetails.xml"); var results = parser.Parse(response); Assert.IsNotNull(results); Assert.IsNotNull(results.InterestingTerms); Assert.AreEqual(4, results.InterestingTerms.Count); Assert.AreEqual("content:three", results.InterestingTerms[2].Key); Assert.AreEqual(3.3f, results.InterestingTerms[2].Value); }
public void ParseInterestingTermsList() { var innerParser = new InterestingTermsResponseParser <Product>(); var parser = new SolrMoreLikeThisHandlerQueryResultsParser <Product>(new[] { innerParser }); var response = EmbeddedResource.GetEmbeddedString(GetType(), "Resources.responseWithInterestingTermsList.xml"); var results = parser.Parse(response); Assert.NotNull(results); Assert.NotNull(results.InterestingTerms); Assert.Equal(4, results.InterestingTerms.Count); Assert.Equal("three", results.InterestingTerms[2].Key); Assert.True(results.InterestingTerms.All(t => t.Value == 0.0f)); }