Use "isIndexing" helper on StrawberryFlavor Data source #330
Labels
bug
Something isn't working
Drupal 10
Upgrade Economy (capitalism)
enhancement
New feature or request
Events and Subscriber
Search API
F around and find out
Strawberry Flavor
Post Processing data extracted that goes into Solr
Typed Data and Search
What?
Been trying to figure out why Views using Flavors as datasources are generating Index changes even when just querying. Drupal loads the Data Source (when using a field that does not say "indexed"?) and by doing that calls the Original key Storage which in turn triggers the dependency checks we do on the Data Source/flavor, and the parent invalidation we also do on indexing. Basically we are "updating" the index when this happens on every query.
This is so silly. Drupal Search API should provide two methods, one for the actual index, one for retrieving from the source. Because it reuses the Load Multiple, and does not provide any context (are we querying? are we actually indexing?) we end over processing.
This has performance effects of course but also basically kills the cache.
Another effect is that if we execute a direct Solr query with PROCESSING FULL (sometimes needed to get the actual NODE) that has Strawberry Flavors, we again trigger a Solr Update.
The solution is to use our new 1.4.0 Service that Sets a Flag when indexing starts via an event. We check via the container if that is the case and then we decide or not if updating tracked/related ADOs are needed or not
Uff. Bright side is: things will run even faster.
The text was updated successfully, but these errors were encountered: