Injectable IPropertyIndexValueFactory implementations into data editors #16781
whitter
started this conversation in
Features and ideas
Replies: 1 comment 4 replies
-
I don't think you need that collection to inject at all, you can decorate interface(scrutor is your friend) and make it conditional in decorator if use base implementation or specific to your need. Also I don't think this implementation of indexing factories should stay in current form, especially when umbraco abstract out examine. I think factories should be independent from data types and have method is suitable factory and then you can have multiple factories for same data type or even shared ones based on some type of logic. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just throwing this out as an idea/getting some input, before I start fiddling with any source code as a proof of concept.
At the moment near enough all the out of the box data types either use the
DefaultPropertyIndexValueFactory
orNoopPropertyIndexValueFactory
with no mechanisms in place to change the implementation out without creating your own data type, which in turn would then require making aPropertyValueConverter
etc... lots of overhead when you just want to change what data is presented to the index.At the moment there are only two places that we have control of to change what data is indexed. That is either implementing
IndexFieldValueType
within Examine, this is fine but I'm personally starting to like the idea of Examine just dealing with primitive data so not concerning its self with what data should be indexed and only detailing with the how data should be indexed.The other place is handling the Examine event to mutate the value set before it past on for indexing, again this is an okay place to change things but within this event we no longer have access to what the data type is/was to be able to change the data based on property information.
Current thinking is to just to make an explicit factory for each data type and inject it.
This is great for a first pass of changes, but would there be any issues that would arise from injecting a collection of factories? Main thinking is that it allows to have individual factories that can contain their own processes without replacing the defaults or fighting against any other factories the community might make.
As a couple of examples of what this would allow:-
Ramble over 😆
Beta Was this translation helpful? Give feedback.
All reactions