Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added parameter to allow filtering using ORM filters #68

Merged
merged 5 commits into from
May 21, 2024
Merged

Added parameter to allow filtering using ORM filters #68

merged 5 commits into from
May 21, 2024

Conversation

jack-nzl
Copy link
Contributor

  • Added parameter to allow filtering using ORM filters in fetchResults method
  • Small tweaks to AlgoliaQuerier and exportAttributesFromObject method on AlgoliaIndexer

@@ -162,8 +162,10 @@ public function exportAttributesFromObject($item)
'objectCreated' => $item->dbObject('Created')->getTimestamp()
];

if ($item->hasMethod('AbsoluteLink')) {
if ($item->hasMethod('AbsoluteLink') && !empty($item->AbsoluteLink())) {
$toIndex['objectLink'] = str_replace(['?stage=Stage', '?stage=Live'], '', $item->AbsoluteLink());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to call AbsoluteLink twice for every record indexing. While that can be a quick method it may also do quite a few look ups (subsite etc). Can we save the value to a value after the hasMethod $link = $item->AbsoluteLink(); and use that $link on the line below. Likewise for link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated now

@wilr wilr merged commit f5cbcbb into wilr:main May 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants