Last active
January 3, 2016 09:59
-
-
Save sirkirby/8446376 to your computer and use it in GitHub Desktop.
Azure Full Text Search Ex 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parse the query | |
var query = multiParser.Parse(phrase); | |
// search the index and return the top 10 best records | |
var results = searcher.Search(query, 10); | |
// loop over my top 10 hits and display the results to the console | |
foreach (var hit in results.ScoreDocs) | |
{ | |
// gets the document from the hit index | |
var doc = searcher.Doc(hit.Doc); | |
// write out the best books matching my phrase | |
Console.WriteLine(string.Format("{0} by {1}", doc.GetField("Title").StringValue, | |
doc.GetField("Author").StringValue)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment