Both the "Aggregated fields" and "Highlight" processors internally use Utility::extractFields() in some cases to get the values of fields that weren't extracted already. However, these calls are currently untested since it's a bit more complicated to mock correctly. Still, we should make sure that the method is correctly called (and its return value correctly used) there, too.

Estimated Value and Story Points

This issue was identified as a Beta Blocker for Drupal 8. We sat down and figured out the value proposition and amount of work (story points) for this issue.

Value and Story points are in the scale of fibonacci. Our minimum is 1, our maximum is 21. The higher, the more value or work a certain issue has.

Value : 1
Story Points: 5

Comments

drunken monkey’s picture

Project: Search API (8.x) » Search API
Version: » 8.x-1.x-dev
nick_vh’s picture

Issue summary: View changes
Issue tags: +beta blocker
drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new32.74 KB

This contains tests for both the "Highlight" and the "Aggregated field" processor and also fixes #2703915: Empty highlighted excerpt due to missing datasource ID.

drunken monkey’s picture

Issue tags: +DevDaysMilan
borisson_’s picture

Status: Needs review » Needs work

Only nitpicks, overall this look good, I'll have another look tomorrow, when I'm not as tired.

  1. +++ b/src/Processor/ProcessorPluginBase.php
    @@ -204,6 +204,112 @@ protected function filterForPropertyPath(array $fields, $property_path) {
    +   * @param \Drupal\search_api\Item\ItemInterface[] $items
    +   *   The items from which properties should be extracted.
    

    An array of items, so to be clear in the description that this is an actual array?

  2. +++ b/src/Processor/ProcessorPluginBase.php
    @@ -204,6 +204,112 @@ protected function filterForPropertyPath(array $fields, $property_path) {
    +    $ret = array();
    

    Can we rename this? At least $return, but preferrably to $extracted_values?

  3. +++ b/src/Processor/ProcessorPluginBase.php
    @@ -204,6 +204,112 @@ protected function filterForPropertyPath(array $fields, $property_path) {
    +        }
    +        foreach ($required_properties[$datasource_id] as $property_path => $combined_id) {
    

    can we add a newline here? for reability?

  4. +++ b/src/Processor/ProcessorPluginBase.php
    @@ -204,6 +204,112 @@ protected function filterForPropertyPath(array $fields, $property_path) {
    +          // don't want to load anything.
    

    Field/property value is not present on the item. Skip this item if we don't want to load it.

drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new3.85 KB
new32.82 KB

Ah, I've missed your nitpicks! Good, to have you back! ;)

An array of items, so to be clear in the description that this is an actual array?

I think the type specification makes that clear enough.

The other three should be fixed in the attached patch – though the last one was really hard to phrase well.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

  • drunken monkey committed c002f81 on 8.x-1.x
    Issue #2305021 by drunken monkey: Fixed field extraction by processors.
    
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Committed.
Thanks!

drunken monkey’s picture

Status: Fixed » Needs review
StatusFileSize
new32.92 KB

This broke tests (or those tests added here were broken afterwards – still, this is as good a place as any to fix them).

drunken monkey’s picture

Status: Needs review » Active

Committed the revert.

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB
new32.89 KB

  • drunken monkey committed f8f9591 on 8.x-1.x
    Issue #2305021 by drunken monkey: Fixed field extraction by processors.
    
drunken monkey’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.