Hi!
Are you sure you want to expose your index like that? This will enable users to search all content, published or not.
I would rather use the example as shown here: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/11/search-statistics/search-statistics/
Or, for full control, create your own controller and use:
SearchClient.Instance.Statistics().GetAutocomplete(query)
Thanks for the answer. That would be more what I am looking for!
Another related question.
Do you know what I am doing wrong?
Not sure about that, but you could try using Fiddler to see what is being tracked. To catch all the request in fiddler, add the following to web.config:
<system.net> <defaultProxy> <!-- fiddler --> <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false"/> </defaultProxy>
Did you have to turn on statistics tracking on index? I think I had to before at least...? Might be worth checking...
If it's still the same, I think that button is on the same interface where you create your developer index...
Hi Daniel, I don't see such a button. I might have found the source of the issue. In the alloy demo site when doing @Html.RequiredClientResources("Footer") it renders this ->
<script type="text/javascript"> void(function(){var tUrl = "/util/LiveMonitor/Tracking/Index?contentId=5&languageId=en";tUrl += (tUrl.indexOf("?") > 0 ? "&" : "?");var tUrl1 = tUrl + "r=" + Math.random() + "&referrer=" + escape(document.referrer);document.write("<img id='LiveMonTransparentImage' src='" + tUrl1 + "' alt='' width='1' height='1'/>");window.onpageshow = function (ev) {if (ev && ev.persisted){document.getElementById("LiveMonTransparentImage").src = tUrl + "r=" + Math.random() + "&referrer=" + escape(document.referrer);}}}()); </script>
but for me it doesn't render anything. Any ideas?
@Daniel, the button for enabling the statistics was removed some time ago. It should automatically be created.
@Andreas, nothing at all? It should render a few things, like script tags for Find.js. You can actually right click and view source on this page(world.episerver.com) which uses Find, and look a the bottom.
@Per No nothing. Not even an empty script tag :/ I've compared with the alloy project but I can't see anything alloy or I do that differs.
@Per
Is the Html.RequiredClientResources necessary for tracking to work when doing server-side search requests?
I've looked in Fiddler but I can't see anything weird. It does do requests to the following Urls /config, /autocomplete, /admin, /search. Although I only get empty result set from /autocomplete and /admin.
For standard click tracking: Yes. For tracking of queries: No, I don't think so.
You should see a request to _track/(some tracking id) as well when executing searches with .Track().
Have you tried with a different index?
I have tried with two different indexes (on different machines as well). I can't see a request to _track unfortunatelly. you want me to send my code to you (maybe I should go via the support?)?
You could try episerver support.
A couple of more tips though: are you doing your queries via web api or similar? Perhaps the currenet language is incorrect.
Also: verify that Find is installed correctly - no missing files/dlls?
I have exactly the same .dlls as the alloy demo site, i've reinstalled Find and still the same issue. I've tried both specifically the correct language as well as null but with no success :/
The index that's not working on my site is working fine in Alloy, the differnce is only the Find version I think...
Which version are you using?
Could you check that you are in fact invoking the correct .Track() method? If my memory serves me right, I've seen (in earlier versions at least) that a Track method that resides in a different namespace had been invoked, causing the tracking not to function, but without giving error messages. Compare which extensions are being used in the alloy site and in your other site
I am trying to get autocomplete to work follwing this guide-> http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/11/searching-with-javascript/Autocomplete/. I have added autocomplete queries in the admin mode but when doing some typing I only get a 403 - forbidden back.