INotificationHandler/Search - Find Product by Cate...
# help-with-umbraco
a
First- I hope this is the right spot... or should this be in the Forums? Trying to understand the best way to implement for a search. I'm creating a "simple" product catalog - which will not be used for purchasing/shopping nor of any large amount of products - but to get ideas of working w/ Umbraco and how I should be using this. I have a "Manufacturer" docType - currently just a name. I have a "Product" docType which - following one of Paul Seal's videos - I'm using a multinodetreepicker which allows only one selection of a single Manufacturer. Everything is great. Let's use "Guitars" as an example - where there would be a "Taylor" manufacturer - and one of the guitar names would be "214ce". Looking at Examine Management - the guitar "214ce" wouldn't include any text of "Taylor" unless the user typed it in somewhere because it's the
umb://document/guid
value. Thinking about editors who may not add "Taylor" - I'm curious what the best approach would be for allowing the "214ce" to show up in my search results even when "Taylor" is searched - if the points are high enough. A "Solution" that I'm feeling isn't very ideal is as follows. * Create a "Mfg Label" as a label on my Product doctype * Upon save of a Product - use the INotificationHanler and set the "mfgLabel" as the Name of the Manufacturer. Which would also require me to also: * Upon saving MFG - only if the "Name" has changed via
IRememberBeingDirty
(lol) * Find all Products w/ that MFG and update their
mfgLabel
Renaming a Category should be a rare occasion - but definitely viable. Or am I holding my relational DB brain to close at the moment? I appreciate any suggestions/feedback!
j
If it is just for searching then it makes more sense to get the parents' name and index that on the childpage whenever it is saved. I wrote a little blog post that describes how that can be done as well as the potential sync issues that may arrise: https://dev.to/jemayn/the-problem-of-referenced-content-in-examine-indexing-umbraco-11-4355
a
@Jemayn this is exactly what I was looking for - and you cleared my confusion - I was thinking I needed a field (label) but you've done it via the
IndexProvider_TransformingIndexValues
Thank you so much! and learning some of these API's - IRelationService - haven't read on that one- this is soo immensely helpful!
j
Happy it could help 🙂
2 Views