Copied to clipboard

Flag this post as spam?

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


  • Bear 40 posts 129 karma points
    Nov 11, 2013 @ 19:04
    Bear
    0

    Examine and Umbraco - Storing Partial Data (Parent Child)

    A simplistic example would be;

    I have a Hotel multi-node tree picker on my Resort doc-type. Each Resort contains n Hotels.

    I want to store some basic information on the Resort about each of the Hotels. This could be the node id, url, latitude & longitude, dates (available from and to) , star rating, guide price and a list of facilities.

    This means I could show a resort and 'at-a-glance' hotel information without having to fully load the hotel (all the extra stuff like a long description, short description, locale, cuisine, climate etc)

    I want to be able to search resorts via examine and quickly find stuff that's in a range so perhaps 'date available from', 'date available to', star rating and perhaps lat & lng.

    I know I can add extra fields on to a record using GatheringNodeData and e.Fields.Add("Hotels", <some serialized value here>)

    What are the best options for serializing the information?

    How could I keep it serialized and easily searchable for a large number of hotels... for example 1 resort could have 50+ hotels

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Nov 12, 2013 @ 11:33
    Ismail Mayat
    0

    Bear,

    If you were not doing range stuff then serialising hotel information and shoving it into the index would be a good option and it would be searchable however as you want range based stuff as well that wont work.

    Maybe better way would the be inverse, so in each hotel record in examine during gathering node find the related resorts and inject that resort data in. So you can then do the search on hotels with range but also search on resort as well.

    You could actually do a bit of both so that you can do the resort and at a glance hotels (inject basic hotel data), and for the range search stuff inject resort data into hotel.

    Regards

    Ismail

  • Bear 40 posts 129 karma points
    Nov 13, 2013 @ 12:10
    Bear
    0

    I see, a bottom up approach... I did consider that but was wondering if there were any options that I didn't know about.

    I did think of some other approaches (not as good though)

    • For a Resort you could keep extending availability dates - so just have earliest and latest on a Resort. This would hold the earliest date you could book and latest date you could book as aggregates from all hotels. This wouldn't work well for geospatial data though.
    • Also, you could do have individual fields for each hotel, perhaps with a some form of composite key Hotel_{nodeId} - e.g. Hotel_123, Hotel_456, Hotel_789 and serialize important info into each field. Then when searching on the Resort look for fields called Hotel and deserialize (could be very time consuming tho). Simiarly just have one field with all basic Hotel information in.
Please Sign in or register to post replies

Write your reply to:

Draft