You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was hoping to use the wildcard to find "stationary" and "stationery" using %. Searching for "station%ry" did not return any results - "stationary stationery" works as expected.
var jsonFile = File.ReadAllText("C:\Users\manderson\Documents\umClasses.json");
var searchModels =
JsonConvert.DeserializeObject<System.Collections.Generic.List>(jsonFile);
var index = new FullTextIndexBuilder()
.WithDefaultTokenization(o => o.WithStemming())
.WithQueryParser(o => o.WithDefaultJoiningOperator(QueryTermJoinOperatorKind.Or))
.WithTextExtractor()
.WithObjectTokenization(
itemOptions => itemOptions
.WithKey(c => c.ClassDescriptionId)
.WithField("GLGuidelines", f => f.GLGuidelines)
).Build();
index.AddRangeAsync(searchModels);
//Was hoping these two counts would be the same
var searchResults = index?.Search("stationary stationery").Count();
var searchResults2 = index?.Search("station%ry").Count();
The text was updated successfully, but these errors were encountered:
The wierdness you're seeing is an unfortunate side-effect of using stemming in the index. The words "stationary" and "stationery" get stemmed to different forms:
This makes wildcard matching behave unexpectedly - there's not really an effective way for LIFTI to stem a wildcard search like this to its index counterpart.
Your options in this case are:
use an ends with wildcard to perform the search, e.g. station* - you could make it even more selective by requiring that at least one character appears after "station": station%*
Armed with the knowledge of how the words are stemmed, search with station%ri
I was hoping to use the wildcard to find "stationary" and "stationery" using %. Searching for "station%ry" did not return any results - "stationary stationery" works as expected.
Enclosed is Json.
umClasses.zip
var jsonFile = File.ReadAllText("C:\Users\manderson\Documents\umClasses.json");
var searchModels =
JsonConvert.DeserializeObject<System.Collections.Generic.List>(jsonFile);
var index = new FullTextIndexBuilder()
.WithDefaultTokenization(o => o.WithStemming())
.WithQueryParser(o => o.WithDefaultJoiningOperator(QueryTermJoinOperatorKind.Or))
.WithTextExtractor()
.WithObjectTokenization(
itemOptions => itemOptions
.WithKey(c => c.ClassDescriptionId)
.WithField("GLGuidelines", f => f.GLGuidelines)
).Build();
index.AddRangeAsync(searchModels);
The text was updated successfully, but these errors were encountered: