Examine search gives me 0 results for german words with umlaut (Vögel, Löwen, Bären etc...) but it works fine if I search it like: Vogel, Lowen, Baren etc...
I dont know where is the problem. This is part of my code:
string nodeName = Culture == "en-US" ? "nodeName_en-us" : "nodeName_de-de";
ExamineManager.Instance.TryGetIndex("ExternalIndex", out var ContentIndex);
var ContentSearcher = ContentIndex.GetSearcher();
List<IPublishedContent> ContentNodes = new List<IPublishedContent>();
if (!String.IsNullOrEmpty(searchTerm))
{
var examineQuery = ContentSearcher.CreateQuery("content").NodeTypeAlias("category");
if (searchTerm.Contains(" "))
{
var terms = searchTerm.Split(' ').Select(x => x.MultipleCharacterWildcard()).ToArray();
examineQuery.And().GroupedOr(new List<string> { nodeName }, terms);
}
else
{
examineQuery.And().GroupedOr(new List<string> { nodeName }, searchTerm.MultipleCharacterWildcard());
}
var results = examineQuery.Execute();
Get rid of wildcard and it will work. So when content is indexed its run through standard analyser and ends up in index ascii flattened, which means umlauts etc got ascii equivalent.
When you search it also goes through anlyser and query gets flattened and it should all work. However when wildcard its not run through ascii flattening therefore it wont match.
no idea you will have to test it. Try it without wildcard first. If that works and you will want wildcard I can see you code where you can ascii flatten the query first then your wilcarding will work.
It looks like I am getting the same results with fuzzy but with good results for words with umlaut. I will test it more, but I am alredy happy with this.
Examine search problem with words with umlaut
Hi all,
Examine search gives me 0 results for german words with umlaut (Vögel, Löwen, Bären etc...) but it works fine if I search it like: Vogel, Lowen, Baren etc...
I dont know where is the problem. This is part of my code:
Josip,
Get rid of wildcard and it will work. So when content is indexed its run through standard analyser and ends up in index ascii flattened, which means umlauts etc got ascii equivalent.
When you search it also goes through anlyser and query gets flattened and it should all work. However when wildcard its not run through ascii flattening therefore it wont match.
Hi Ismail,
Should I use Fuzzy instead MultipleCharacterWildcard? Would I get the same results?
BR
Josip
no idea you will have to test it. Try it without wildcard first. If that works and you will want wildcard I can see you code where you can ascii flatten the query first then your wilcarding will work.
Ok thanks,
but yes MultipleCharacterWildcard was making that problem, without it It working as expected.
Thanks a lot
BR
Josip
kk so try it with fuzzy and if that dont work then you need to run it through https://gist.github.com/ismailmayat/1b42271b883e31962d72091d17f0bae8 dont forget to update lucene version to 3 as this code has 2.9 it also has links to explain more about the issue
It looks like I am getting the same results with fuzzy but with good results for words with umlaut. I will test it more, but I am alredy happy with this.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.