Copied to clipboard

Flag this post as spam?

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


  • Dhanesh Kumar MJ 165 posts 521 karma points MVP c-trib
    Aug 01, 2021 @ 15:51
    Dhanesh Kumar MJ
    0

    What are the best approaches to index custom data in Umbraco v8?

    We have a requirement to include some external data from an API endpoint to umbraco index.so what are the best approaches to do?,please guide

    Regards Dhanesh ;)

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Aug 01, 2021 @ 19:59
    Bjarne Fyrstenborg
    101

    Hi Dhanesh

    You have a few options to include/import custom data to Umbraco.

    You can use Examine to create a custom Lucene index, which is useful if you also need to search/filter these data. Here is an example hos to create a custom index: https://our.umbraco.com/Documentation/Reference/Searching/Examine/indexing/#productindexcreator

    Another option is to create a document type based on this data source, e.g. a Product document type and create/update properties on this node based on the external data using ContentService. However be aware that each time the node is saved it will create a new version. You can use a package like UnVersion to cleanup older versions https://our.umbraco.com/packages/website-utilities/unversion/ or e.g. compare the specific properties on the node with the external data to check if it need to update/save the node again. For example it the values in the specific properties on the node are identical with the external data, you probably don't need to save the node.

    Furthermore you could also store the data in a custom database table or store the data as JSON file(s) in a folder on the disk.

  • Dhanesh Kumar MJ 165 posts 521 karma points MVP c-trib
    Aug 02, 2021 @ 03:11
    Dhanesh Kumar MJ
    0

    Thanks Bjarne.

    Going with custom index instead of updating content property, because the data needs to import on an interval basis.

    Regards Dhanesh ;)

Please Sign in or register to post replies

Write your reply to:

Draft