Recently I've been experimenting with EPiServer Find, I'm trying to figure out how wildcard queries are used.
I am encountering the following difficulty:
One of my colleagues has set up a POC with EPiServerFind, sadly this only searches for the entire word. For example: If you search 'applepie' you will find the page but searching 'apple' or 'pie' won't find the page. I've looked into wildcard queries to solve this, however I get unexpected results when I use them.
Details Like I've pointed out earlier, whenever I query EPiServerFind I get only full word matches.
var basicSearch = _client.Search()
.For(q)
.InFields(x => x.Name, x => x.SearchTitle(), x => x.SearchText())
.InAllField()
.ExcludeContainerPages()
.ExcludeContentFolders()
.ExcludeDeleted()
.GetContentResult()
.Select(CreateSearchHitViewModel)
.Where(x => x != null);
I've used an article of Joel Abrahamsson to help me with the implementation of the wildcard query:
var wildcardSearch = _client.Search()
.WildCardQuery(String.Format("*{0}*", q), x => x.Name)
.WildCardQuery(String.Format("*{0}*", q), x => x.SearchTitle())
.WildCardQuery(String.Format("*{0}*", q), x => x.SearchText())
.ExcludeContainerPages()
.ExcludeContentFolders()
.ExcludeDeleted()
.GetContentResult()
.Select(CreateSearchHitViewModel)
.Where(x => x != null);
Recently I've been experimenting with EPiServer Find, I'm trying to figure out how wildcard queries are used.
I am encountering the following difficulty:
One of my colleagues has set up a POC with EPiServerFind, sadly this only searches for the entire word. For example: If you search 'applepie' you will find the page but searching 'apple' or 'pie' won't find the page. I've looked into wildcard queries to solve this, however I get unexpected results when I use them.
Details Like I've pointed out earlier, whenever I query EPiServerFind I get only full word matches.
I've used an article of Joel Abrahamsson to help me with the implementation of the wildcard query:
I've used this blog: http://joelabrahamsson.com/wildcard-queries-with-EPiServer-find/
Sadly I get unexpected results when I use this. I get a few unrelated results but more of the relevant results are completely ignored.
I have no clue as to where this is failing and I hope someone can tell me.
Thank you in advance.