Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Hello Islam
Using Find to provide autocomplete search results is certainly possible. The code below can be used to provide a suggested list of results for Name property of the Foo type:
public JsonResult Prefix(string term) { var results = client.Search<Foo>() .Filter(x => x.Name.PrefixCaseInsensitive(term)) .Select(x => x.Name) .StaticallyCacheFor(TimeSpan.FromHours(1)) .GetResult(); return Json(results.Select(x => x), JsonRequestBehavior.AllowGet); }
Simply add the code above to a controller to use in your client side javascript.
David
Hi,
I have a question reagrding search suggestions.
Is it possible to implement auto suggest using EPiServer Find?
I checked the Find SDK and there is an example for auto complete which is totally understandable.
I just want to know if it is possible to suggest variants without doing a search.
Thank you.