public void WhenLoadingLotsOfDataShouldNotError() { foreach (var entry in WikipediaDataLoader.Load(this.GetType())) { this.index.Index(entry.name, entry.text); } }
public async Task InitializeAsync() { this.index = new FullTextIndexBuilder <string>().Build(); var wikipediaTests = WikipediaDataLoader.Load(typeof(FullTextIndexTests)); var options = new TokenizationOptionsBuilder().XmlContent().WithStemming().Build(); foreach (var(name, text) in wikipediaTests) { await this.index.AddAsync(name, text, options); } }
public static async Task RunAsync() { var index = new FullTextIndexBuilder <string>() .WithDefaultTokenizationOptions(o => o.WithStemming().XmlContent()) .Build(); var wikipediaTests = WikipediaDataLoader.Load(typeof(WikipediaSample)); foreach (var(name, text) in wikipediaTests) { await index.AddAsync(name, text); } }
private async Task <IList <(string name, string text)> > PopulateIndexWithWikipediaData() { var wikipediaTests = WikipediaDataLoader.Load(this.GetType()); this.index.BeginBatchChange(); foreach (var(name, text) in wikipediaTests) { await this.index.AddAsync(name, text); } await this.index.CommitBatchChangeAsync(); return(wikipediaTests); }
public async Task WhenLoadingLotsOfDataShouldNotError() { var wikipediaTests = WikipediaDataLoader.Load(this.GetType()); this.index.BeginBatchChange(); foreach (var(name, text) in wikipediaTests) { await this.index.AddAsync(name, text); } await this.index.CommitBatchChangeAsync(); await this.index.RemoveAsync(wikipediaTests[10].name); await this.index.RemoveAsync(wikipediaTests[9].name); await this.index.RemoveAsync(wikipediaTests[8].name); }
private async Task <FullTextIndex <string> > CreateWikipediaIndexAsync() { var index = new FullTextIndexBuilder <string>() .WithTextExtractor <XmlTextExtractor>() .WithDefaultTokenization(o => o.WithStemming()) .Build(); var wikipediaTests = WikipediaDataLoader.Load(typeof(FullTextIndexTests)); foreach (var(name, text) in wikipediaTests) { await index.AddAsync(name, text); } // For good measure, index some surrogate pairs await index.AddAsync("Emoji", "Emojis can cause problems 🤷♀️ 🤷🏾♂️"); return(index); }