November Happy Hour will be moved to Thursday December 5th.

Autocomplete is returning 0 Hits Find 11

Vote:
 

Hello,

I am using Episerver Find 11 and implementing the autocomplete functuionality using Jquery as mention on episerver document http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/11/search-statistics/search-statistics/

This is my search button

 



 

This is my script code.



When I check data using url http://localhost:55363/find_v2/_autocomplete?prefix=ho&size=5 on my localhost it gives me following results.

{"status":"ok","hits":[{"query":"homeclass","type":"editorial"},{"query":"homemade","type":"editorial"},{"query":"homemaid","type":"editorial"},{"query":"homework","type":"editorial"},{"query":"homeland","type":"editorial"}]}

but when I run the code on UI and search, in alert I am geeting 0 hits and alert is showing 

{"status":"ok","hits":[]}



Also In my controller for tracking I am using .track() method.

var unifiedSearch = SearchClient.Instance.UnifiedSearchFor(q).UsingSynonyms().ApplyBestBets().Track().Skip(skipNumber).Take(pageSize);

Thanks in advance,

#180211
Edited, Jul 03, 2017 12:31
Vote:
 

You are searching for the term "q", and not from your search input field.

Something like this should work:

$.get('/find_v2/_autocomplete?prefix='+  $('#search').val() + '&size=4'
#180213
Jul 03, 2017 13:00
Vote:
 

Hello,

@Per Magne Skuseth

Yes using

$.get('/find_v2/_autocomplete?prefix='+  $('#search').val() + '&size=4'

I am getting data in alert.But still it is not showing all the 4 auto suggestions in textbox.

or better How can I show autosuggestion.

Will this work 

$('#search').append(value.Query);
#180214
Jul 03, 2017 13:07
Vote:
 

I suggest you install an episerver Alloy site with Episerver Find installed. Then you should check out the view for the FindSearchPage. You'll find a good example of an implementation of autocomplete there.

#180215
Jul 03, 2017 13:18
Vote:
 

Okay,

Thanks for the suggestion.

#180216
Jul 03, 2017 13:20
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.