Hi,In my project when trying to use HitProjectionBuilder I get a message saying it's obsolete and to use IndexProjectionBuilder. Okay no problem, but there aren't any information that I can find that describes how to use IndexProjectionBuilder. I just want to understand the diffrence between IndexProjectionBuilder and HitProjectionBuilder other that ProjectOriginalObjectGetterFrom doesn't seem to exist. Someone thought that IndexProjectionBuilder runs when indexing an object while hitprojectionsBuilder runs everytime you get hits from a search. Is this correct?Please could someone enlighten me on my path forward. :-D
Should I use IndexProjectionBuilder or stick with HitProjectionBuilder? Using latest epi and find.
Thanks in advance
Hi,The difference between IndexProjectionBuilder and HitProjectionBuilder is as you have stated that the IndexProjectionBuilder executes when indexing while HitProjectionsBuilder runs on the search results. The benefit of running the IndexProjectionBuilder is that your projections will be persisted in the index and therefore searchable. This is the reason why I would say that you should always use the IndexProjectionBuilder. Before the IndexProjectionBuilder was added there where some confusion that the data that was queried and what was returned in the result was different (as the HitProjectionBuilder replaced the index data with the projection after the query was excuted) and this is the reason why the switch was made to have the projections persisted in the index by default and marking the HitProjectionBuilder mappings as obsolete.
/HenrikThe reason why ProjectOriginalObjectGetterFrom isn't available on the IndexProjectionBuilder is that it doesn't make sense to store in the index as it is a mapping between the search result object and the original object that was mapped to the unified search object.