Merge pull request #17298 from abpframework/EngincanV/fix-duplicate-results

Docs: Fix duplicate document results in search
pull/17306/head
liangshiwei 2 years ago committed by GitHub
commit 16e2af6c92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -204,11 +204,18 @@ namespace Volo.Docs.Documents.FullSearch.Elastic
foreach (var hit in response.Hits)
{
var doc = hit.Source;
if(docs.Any(x => x.Id == doc.Id))
{
continue;
}
if (hit.Highlight.ContainsKey("content"))
{
doc.Highlight = new List<string>();
doc.Highlight.AddRange(hit.Highlight["content"]);
}
docs.Add(doc);
}

Loading…
Cancel
Save