2024-06-26 - SearchResult linkpath

From Izara Wiki
Jump to navigation Jump to search

Service - Search Results

Overview

SearchResult and SearchResult want main to include fields/requiredData from many linked objTypes, to do this we create requiredData that has a linkPath pointing to the final data wanted.

Each step in the linkPath can have it's own search params and filters, allowing for complex results to be found.

Recursive link path steps

Problem

some links may recurse such as attribute trees (product attributes) and we do not know at what level the result we are searching for will be.

Solution

  • Identifier link step can take a link path that it recurses
  • maybe similar to cypher/deepPathSearch recursion structure
  • perhaps an array of links or relationshipTags that it recurses up to a limit, if it finds any matching objType+identifier it stops recursion and returns the preceeding identifier
  • perhaps a setting what identifier it returns (preeceeding/origin(useful?)/leaf)
  • if none found same as normal identifier, that origin identifier gets dropped

Can be inserted into linkPath array to get required results, eg to find value of sellOfferTermAttribute:

  • product links to sellOffer no aggregate (returns multiple identifiers)
  • sellOffer links to sellOfferTermAttributeLink no aggregate (returns multiple identifiers)
  • sellOfferTermAttributeLink links to sellOfferTermAttributeValue (to 1, one identifer per previous multiple)
  • sellOfferTermAttributeValue links to sellOfferTermAttributeLabel using linkType "identifier" which will drop any previous identifier that does not match the required label
  • linkPath then continues from sellOfferTermAttributeValue and links to translation to get string value required, this final step needs to aggregate in some way to return one value