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

_deleteFromIndex is unimplemented #1

Open
jnugent opened this issue May 7, 2020 · 4 comments
Open

_deleteFromIndex is unimplemented #1

jnugent opened this issue May 7, 2020 · 4 comments

Comments

@jnugent
Copy link

jnugent commented May 7, 2020

Hi there. We're using the plugin to integrate an Algolia search, but we've found a bug. It seems that right now it is not possible to easily clear the search index. There's a method in the AlgoliaService class called deleteArticlesFromIndex that wants to call _deleteFromIndex, but that method is unimplemented and results in a fatal error:

Uncaught Error: Call to undefined method AlgoliaService::_deleteFromIndex()

@smaida
Copy link

smaida commented May 7, 2020

@jnugent Are you willing to make a pull request for this? We built this plugin for a specific client of ours with the hope that the PKP team would take over management of this plugin in an effort to bring Algolia to more OJS users. We no longer have any active OJS projects, so although we're hosting this repo, we're not in the best position to support it.

@jnugent
Copy link
Author

jnugent commented May 7, 2020

@smaida I'm on said PKP team, and the client in question hitting this issue is the client that I believe the plugin was built for, so I'm not sure who's umbrella this bug falls under. There's not really anyone at the PKP team experienced with Algolia Search, unfortunately. Is there any documentation for how the missing functionality should be implemented?

@smaida
Copy link

smaida commented May 7, 2020

@jnugent Thank you. We're not under contract, so we're really not in a position to help them. Not unwilling, just that no vehicle exists for doing the work.

Looking at the code, it seems to me that the easiest approach would likely be to update the deleteArticlesFromIndex method so that it obtains the list of article ids for the journal, and then iteratively calls the deleteArticleFromIndex method, passing in each article id, rather than calling _deleteFromIndex.

https://github.com/fostermadeco/ojs-algolia/blob/master/classes/AlgoliaService.inc.php#L221
https://github.com/fostermadeco/ojs-algolia/blob/master/classes/AlgoliaService.inc.php#L200

@smaida
Copy link

smaida commented May 7, 2020

Also, I should note here that Algolia's docs now reflect v2 of the php library. This plugin is using v1.

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

No branches or pull requests

2 participants