episerver / EPiServer.Labs.Find.Toolbox

Find Toolbox features an improved synonym implementation, MinimumShouldMatch, MatchPhrase, MatchPrefixPhrase, FuzzyQuery, WildcardQuery and custom CMS search providers
Apache License 2.0
8 stars 2 forks source link

.UsingSynonymsImproved cacheing doesn't appear to be working for CMS 12. #15

Closed mttwParagon closed 5 months ago

mttwParagon commented 5 months ago

Describe the bug We have been experiencing 429 errors while searching using the find toolbox. We see a large number of calls to find in order to load our~500 or so synonyms when using 'UsingSynonymsImproved'.

To Reproduce Steps to reproduce the behavior:

  1. [Paste code for SynonymsImproved implementation)

    var term = "Blank Range";//example search. var ProductSearchService = _searchClient.Search(Language.English); ProductSearchService = ProductSearchService.For(term) .InField(x => x.AggregateFieldsForSearch())//custom aggregate of fields .InField(x => x.GetDisplayName())//fields need to be included separately from the aggregate field if we want to boost them .InField(x => x.Code) .InField(x => x.CrossItems) .MinimumShouldMatch(2) .UsingSynonymsImproved(TimeSpan.FromHours(4)) .ApplyBestBets() .WildcardSearch(term, (x => x.Code, boostCode), (x => x.CrossItems, boostCrossItems), (x => x.GetDisplayName(), boostName));

    var sr = ProductSearchService .StaticallyCacheFor(TimeSpan.FromMinutes(60)) .CurrentlyPublished() .GetContentResult(); //Use GetContentResult for content Items. GetResult will fail on deserializing item associations.

  2. Searching for 'a simple search' Terms can be any mulitword search ex: air freshener, blue paint. etc

  3. Observe search results works fine under light load (evening, nighttime). Fails with 429 during busy periods of the day (day start, late afternoon). Actual behavior A clear and concise description of what is happening. Searches will fail when the site is under high traffic when UsingSynonymsImproved
    Expected behavior Searches to consistently return results under normal load.

Additional information