Copied to clipboard

Flag this post as spam?

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


  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Dec 25, 2016 @ 14:23
    David Brendel
    0

    Hi everyone,

    I'm currently trying to implement some custom examine indexing/searching. For this I have multiple index sets in which different entities are indexed. Some of these entities are related to each other. The relation is implemented with foreign ids. So for example Location -> Adress is related by Location.AddressId.

    Is there a way to implement a custom searcher which can relate both index sets during searching or do I have to implement my searcher to first search my locations and then search my addresses and after that merge everything together manually?

    Hope somebody has an idea.

    Regards David

  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Dec 27, 2016 @ 09:06
    Damiaan
    100

    As far as I know you can't combine indexes in searchers as you expect. There are in lucene ways to "Join", but I don't think they are supported in the current version which is provided with umbraco.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jan 02, 2017 @ 07:55
    David Brendel
    0

    Hi Damiaan,

    thanks for the hint. I will look at lucene. But I also think that the version is probaply not used in umbraco.

    Regards David

  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Jan 02, 2017 @ 09:52
    Damiaan
    0

    Why not merging the 2 merge at index time and add a "TYPE" field? then you can do a search and know which document type you get back...

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jan 02, 2017 @ 12:04
    David Brendel
    0

    Hi Damiaan,

    not really a fan of this approach. I'm indexing custom stuff and with this I would have a lot of empty fields which are special for each of the types I'm indexing. Not really good practice I think.

    Regards David

  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Jan 03, 2017 @ 08:54
    Damiaan
    0

    I guess that this is not a problem. I've tweeted to Ismail. :-) Hope he can share some insights.

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jan 03, 2017 @ 09:04
    Ismail Mayat
    1

    David,

    You can search multiple indexes however you cannot do a sql type join as its not a relational database.

    You could in theory build a third index which contains denormalised data that has all fields you want to search on and display.

    Regards

    Ismail

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jan 03, 2017 @ 15:20
    David Brendel
    0

    Hi Ismail,

    thanks for the insights.

    Think I'm indeed on the wrong track of what I try to achieve. Maybe it is in fact the right thing to denormalise the data and add every searchable field to the index even if it originally comes from a related object.

    As the index is just for finding the stuff and showing them in the search results.

    I will think about it a bit.

    But thanks for the hints and suggestions Ismail and Damiaan!

    Regards David

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jan 03, 2017 @ 15:28
    Ismail Mayat
    2

    David,

    Common mistake, we have to think about sql structured normalised tables etc differently from search indexes which are flat they are different beasts altogether.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft