Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[SDPAP-6684] Verify items in search index drush command #39

Conversation

MdNadimHossain
Copy link
Contributor

@MdNadimHossain MdNadimHossain commented Oct 13, 2022

JIRA

https://digital-vic.atlassian.net/browse/SDPAP-6684

Changes

  1. Made a new drush command to compare the published node ids from the CMS with the search index

Testing PR

https://nginx-php.pr-142.content-reference-sdp-vic-gov-au.sdp4.sdp.vic.gov.au

Test steps

  1. are added in the ticket
  2. Also added dedicated search index for the PR so it does not get overwritten with other PR

composer.json Outdated
@@ -6,12 +6,19 @@
"require": {
"drupal/search_api": "^1.11",
"drupal/elasticsearch_connector": "^7.0",
"dpc-sdp/tide_core": "^3.0.0"
"dpc-sdp/tide_core": "dev-feature/SRM-512_update_drupal_to_9.4"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will be reverted before merging

dev-tools.sh Outdated
@@ -33,6 +33,6 @@
# stable version.
#
# Uncomment and set the Dev-Tools's commit value and commit this change.
# export GH_COMMIT=COMMIT_SHA
export GH_COMMIT=960eba39ed9543b17654dbd5e06f3a2ab2b1fb4b
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will be reverted before merging

/**
* Helper to convert node ids.
*/
public static function convertToNodeIds($item) {
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @MdNadimHossain ,
I think you don't need the function convertToNodeIds.
the $results is an object that implements ResultInterface, so I think you can get the actual result by using $results->getExtraData('elasticsearch_response') or $results->getAllExtraData() , then loop through to get nid from the result.

@MdNadimHossain
Copy link
Contributor Author

Thanks @vincent-gao for pointing out that.
I have made the changes

@MdNadimHossain MdNadimHossain merged commit d596067 into develop Nov 11, 2022
@MdNadimHossain MdNadimHossain deleted the feature/SDPAP-6684-verify-items-in-search-index-drush-command branch November 11, 2022 02:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants