Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • shinsuke nakayama 109 posts 250 karma points
    Nov 03, 2014 @ 04:19
    shinsuke nakayama

    Umbraco 7 Search and Multi Language website

    Hi guys,

    I have this multi language website, lets say english and japanese.

    On the root of the each site, i have setup "Culture and hostnames", and it's all working fine, except search. When I was testing search functionality I noticed that it was retrieving English contents on the Japanese site search.

    My code for the search looks like this.

    public IList<SearchDto> Search(string keyword)
        var list = new List<SearchDto>();
        var manager = new SearchManager();
        foreach (IPublishedContent item in Umbraco.Search(keyword))
        return list;

    Is there any way of just searching the site your currently in? than searching the whole website in the cms database?

    Thank you


  • shinsuke nakayama 109 posts 250 karma points
    Nov 03, 2014 @ 09:48
    shinsuke nakayama

    okay i manage to get it working. This is what i've done


    <IndexSet SetName="en-AU-ExternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/External-en-NZ" IndexParentId="2856" />


    //in ExamineIndexProviders
    <add name="en-NZ-ExternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine" />
    //in ExamineSearchProviders
    <add name="ExternalSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" />


    var searcherName = CultureInfo.CurrentCulture + "-ExternalSearcher";
    var searcher = ExamineManager.Instance.SearchProviderCollection[searcherName];
    var results = searcher.Search(q, false);

    Only my concern is this search result returns type of ISearchResults and not iPublishedContent, but i can live with that :)

  • shinsuke nakayama 109 posts 250 karma points
    Nov 03, 2014 @ 09:51
    shinsuke nakayama

    Only thing with this is i have to have Examine index setup for all extra language and define the site root ID identified in the ExamineIndex.config, so if there's any other way, please feel free to share your idea :)



  • Ismail Mayat 4511 posts 10061 karma points MVP 2x admin c-trib
    Nov 03, 2014 @ 10:48
    Ismail Mayat


    Your way works fine, one advantage this way is you could implement japanese analyser see however one other way would be you have one index and you use gatheringnode data event to inject in a new field called searchable path which is has the path field and then you as part of your query tell it to restict the search to the root id of the language see on how to do this.



  • Chris Roberts 74 posts 106 karma points c-trib
    Aug 10, 2015 @ 14:07
    Chris Roberts


    We are having a problem getting search work on our Japanese website. From what I can find by searching, it appears that you need to use a Japanese-specific analyser for Examine to be able to work with Japanese.

    I'm having trouble finding a suitable .NET analyser, though - most of the things I can find appear to be for Java.

    Does anyone know where I can get an Examine-friendly Japanese analyser?

    Thanks, Chris

  • shinsuke nakayama 109 posts 250 karma points
    Aug 11, 2015 @ 02:32
    shinsuke nakayama


    I had quick look at it, and i think i found something for .net But can you read japanese??

    article here

    dll file here

    there's some sample code on page 2 and 3.

    Let me know how it go, I'll probably have to implement this when i start building more Japanese sites.


    on the site, it also said something about MeCab, which go and fixes japanese characters. I'm not quite sure what it is. I just did google translate and the translation was quite spot on


    I found a blog, he talks about his experience on using this:

    he talks about what he did to improve performance, etc.

    Good Luck

Please Sign in or register to post replies

Write your reply to: