Copied to clipboard

Flag this post as spam?

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


  • Bo Jacobsen 590 posts 2366 karma points
    Apr 04, 2019 @ 20:22
    Bo Jacobsen
    0

    Lucene search for multilangual site in Umbraco 8

    Hi all.

    How would you do a search for a specific language in Umbraco 8?

    In Umbraco 7, we just added the path to the index. And we can do the same in Umbraco 8, if we create a node tree for both languages.

    But if we allow varying by culture, they share the same path. But now they have properties with culture extensions on same results.

    Eksampel:

    I create a node with alias home, with one property called teststring and allowed varying by culture.

    When i search da or en i get these results:

    __NodeId: 1062

    __NodeTypeAlias: home

    __Path: -1,1062

    __VariesByCulture: y

    nodeName: DA

    nodeName_da-dk: DA

    nodeName_en-us: EN

    teststring_da-dk: Dansk

    teststring_en-us: English

    How would you do it?

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Apr 04, 2019 @ 21:55
    Søren Gregersen
    0

    You should be able to do a search om just the fields with the culture suffix you need.

    Also, when Reading results, can’t you then Use the culture suffix to read the right fields?

  • Bo Jacobsen 590 posts 2366 karma points
    Apr 05, 2019 @ 09:20
    Bo Jacobsen
    0

    Hi Søren.

    On a fixed search where we define the fields to search in, that would be possible, and might be they way we go.

    But if the fields are added dynamicly when you create new properties, then you get all results even if it is not in the language you search in.

    So i am just trying to get some good ideas :)

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Apr 05, 2019 @ 09:24
    Søren Gregersen
    0

    say your content has fields like: title teaser content link

    Then you'd get titleda-dk titleen-us etc...

    when constructing your search result, you should/coulkd then use the fields from the doctype, and the variant/language suffix.

    so, en-us => new{ title = titleen-us ... } and, da-da => new{ title = titleda-dk ... }

    Does that makee sense?

    I don't think the above it there out of the box

  • Bo Jacobsen 590 posts 2366 karma points
    Apr 08, 2019 @ 11:09
    Bo Jacobsen
    0

    Hi Søren.

    I will try and play around with it.

Please Sign in or register to post replies

Write your reply to:

Draft