Copied to clipboard

Flag this post as spam?

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


  • Michael 115 posts 369 karma points
    1 week ago
    Michael
    0

    What about multiple root nodes

    Hi Darren,

    I'm going to start using your plugin, but I have question about multiple hostnames:

    websitename/en

    websitename/de

    websitename/dk

    How I can index separately this content and search directly in relevant index. Is it possible to add multiple indexes, or we can manage this in single?

    Thanks, Mike

  • Ryan McDonough 7 posts 80 karma points c-trib
    1 week ago
    Ryan McDonough
    0

    In your /config/ExamineIndex.config you'll see the current indexes.

    You can create a new index per language:

      <IndexSet SetName="en_SiteSearchIndexSet"  IndexPath="~/App_Data/TEMP/ExamineIndexes/enSiteSearch/"  IndexParentId="1250" >
           <IndexAttributeFields>
      <add Name="id" />
      <add Name="nodeName"/>
      <add Name="updateDate" />
      <add Name="writerName" />
      <add Name="loginName" />
      <add Name="email" />
      <add Name="nodeTypeAlias" />
    </IndexAttributeFields>     
      </IndexSet>
    

    Noting the IndexParentId=1250, that would be the ID of the root node for the language you want to index.

  • Michael 115 posts 369 karma points
    7 days ago
    Michael
    0

    Hi Rayan,

    Thanks for this, currently I'm using the same structure for Examine. I see that Azure Search plugin has a bit different config with single Index name. Also free tier support up to 3 indexes.

    Thanks, Mike

  • Darren Ferguson 994 posts 3103 karma points mvp c-trib
    6 days ago
    Darren Ferguson
    0

    Hi Ryan,

    I'd always advise against doing this if using Examine. The more indexes you have - the slower Umbraco is to startup.

    A better way is to filter at query level, ensuring that the parent node Id is in the path.

    Thanks.

  • Darren Ferguson 994 posts 3103 karma points mvp c-trib
    6 days ago
    Darren Ferguson
    0

    Hi Mike,

    Sorry for the delay. I'm on holiday just now.

    I'd take the approach of filtering results at query level, the package doesn't support multiple indexes.

    You can use the search client to filter results based on the Path field in the index (which is a list of Ids), or filter based on the Url property in the index - using a wildcard. e.g.

    client.Filter("path", 1042).Results();

    or client.Filter("Url", "/en/*").Results();

    A slightly nicer way to do it may be to store the country name for a node in a custom field in the index and filter on that - there is an indexing event that allows you to add custom fields - just be careful not to do anything to inefficient in an indexing event, or the process will slow right down.

    As mentioned I'm away from the office just now. I could put together a real code example when I am back - the snippets above are guessed/from memory.

    Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft