Closed tiago-soczek closed 9 months ago
Hi @tiago-soczek!
There's nothing built in - there's a general expectation that you'll still be able to query the original source text/object that was used to construct the index.
For example, when you're extracting matched phrases from search results, you're required to pass a delegate that returns the original:
foreach (var result in await results.CreateMatchPhrasesAsync(i => books.First(x => x.BookId == i)))
{
Console.WriteLine($"{result.SearchResult.Key} ({result.SearchResult.Score})");
foreach (var fieldPhrase in result.FieldPhrases)
{
Console.Write($" {fieldPhrase.FoundIn}: ");
Console.WriteLine(string.Join(", ", fieldPhrase.Phrases.Select(x => $"\"{x}\"")));
}
}
One of the objectives of indexing like this is to reduce the overall memory requirements of searching across all the items - storing the the original in memory would defeat that.
Thanks @mikegoatly, got it! I'll change my implementation here!
Hello!
Is it possible to obtain the complete document by ID? When getting the results, I would like to have all the fields and values in the document, not just the ones that matched (
FieldMatches
).