Examine Searching Umbraco + External Database Data
Hi Umbracians!
For a client running Umbraco 8.17 we are working on a Search & Filter implementation using Examine, and I am hoping we could get some advice from the community!
The platform consists of a handful of different Umbraco Doctypes that we're searching through using Examine's/Umbraco's ExternalIndex. 90% of our content lives in Umbraco, so that's no problem at all. We're currently on the fence on what to do with the remaining 10%. One specific doctype in Umbraco is only used as a reference to data stored in an external database, and we don't have the option available to store that info in Umbraco within a Content Item (as a business rule). We are however interested in searching through several fields stored in said external database, next to all of our Umbraco content.
We're currently envisioning two options, and we would like to hear which one you would choose: (Or recommend us a third option if out there!)
Creating a completely new Index within Examine, and whenever we update our external database, we update that new Index. When searching through content as a frontend user, we would go through both the Umbraco ExternalIndex and our new index to find and display all the content we need from both sources.
We extend the ExternalIndex with custom fields/data whenever we update our external database. When searching through content as a frontend user, we would only have to use the ExternalIndex.
??
I would love to hear what you would recommend we do in this situation!
With option one 1 you could retrieve the information from the database when the content item holding the reference is being indexed. But this will require you to write some mechanism to re-index the node when the data is changed in the database. The advantage is that you only have one index to query.
With option two you can store all the information needed from the database in a custom index. That way you can update that index when something in the database changes without knowing the node that holds the reference. You can then use a multi index searcher to search for the data on both the external and your custom index. Downside is that your index does not know the relation between the node holding the reference and your content item. Which might lead to unwanted search results.
Without knowing more details it is hard to recommend a correct approach.
Examine Searching Umbraco + External Database Data
Hi Umbracians!
For a client running Umbraco 8.17 we are working on a Search & Filter implementation using Examine, and I am hoping we could get some advice from the community!
The platform consists of a handful of different Umbraco Doctypes that we're searching through using Examine's/Umbraco's ExternalIndex. 90% of our content lives in Umbraco, so that's no problem at all. We're currently on the fence on what to do with the remaining 10%. One specific doctype in Umbraco is only used as a reference to data stored in an external database, and we don't have the option available to store that info in Umbraco within a Content Item (as a business rule). We are however interested in searching through several fields stored in said external database, next to all of our Umbraco content.
We're currently envisioning two options, and we would like to hear which one you would choose: (Or recommend us a third option if out there!)
I would love to hear what you would recommend we do in this situation!
Kind regards,
Corné Hoskam
Hi Corné,
With option one 1 you could retrieve the information from the database when the content item holding the reference is being indexed. But this will require you to write some mechanism to re-index the node when the data is changed in the database. The advantage is that you only have one index to query.
With option two you can store all the information needed from the database in a custom index. That way you can update that index when something in the database changes without knowing the node that holds the reference. You can then use a multi index searcher to search for the data on both the external and your custom index. Downside is that your index does not know the relation between the node holding the reference and your content item. Which might lead to unwanted search results.
Without knowing more details it is hard to recommend a correct approach.
This article has some examples on creating custom indexes and multi index searchers : https://skrift.io/issues/examine-in-umbraco-8/
Dave
is working on a reply...