Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I'm trying to use an interceptor to populate my own search results in a custom section. I've registered it in my app package.manifest.
angular.module('umbraco').service('SearchInterceptor', function () { var service = this; service.request = function (request) { if (request.url == "/umbraco/backoffice/UmbracoApi/Entity/SearchAll") { alert("Hello"); } return request; }; }); angular.module('umbraco').config(function ($httpProvider) { $httpProvider.interceptors.push('SearchInterceptor'); });
Anyone any ideas?
Answer
angular.module('umbraco').service('SearchInterceptor', function () { var service = this; service.request = function (request) { if (request.url.indexOf("/umbraco/backoffice/UmbracoApi/Entity/SearchAll")!== -1) { alert("Hello"); } return request; }; }); angular.module('umbraco').config(function ($httpProvider) { $httpProvider.interceptors.push('SearchInterceptor'); });
Hi John,
You probably need to implement an ISearchableTree (https://our.umbraco.com/apidocs/csharp/api/Umbraco.Web.Search.ISearchableTree.html)
Some more info can also be found in this issue : https://issues.umbraco.org/issue/U4-2676
But I must say I haven't tried it yet.
Dave
Thanks Dave,
I've gone in that direction but hit the obstacle how to using ISearchableTree with my own results.
Created a separate post https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/94152-how-to-use-isearchabletree-for-custom-section-search
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Custom Section Search
Hi all,
I'm trying to use an interceptor to populate my own search results in a custom section. I've registered it in my app package.manifest.
Anyone any ideas?
Answer
Hi John,
You probably need to implement an ISearchableTree (https://our.umbraco.com/apidocs/csharp/api/Umbraco.Web.Search.ISearchableTree.html)
Some more info can also be found in this issue : https://issues.umbraco.org/issue/U4-2676
But I must say I haven't tried it yet.
Dave
Thanks Dave,
I've gone in that direction but hit the obstacle how to using ISearchableTree with my own results.
Created a separate post https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/94152-how-to-use-isearchabletree-for-custom-section-search
is working on a reply...