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

ArticleSearchIndex::_updateTextIndex() clears prior indexed content #2327

Closed
ctgraham opened this issue Mar 1, 2017 · 5 comments
Closed
Assignees
Milestone

Comments

@ctgraham
Copy link
Collaborator

ctgraham commented Mar 1, 2017

Calls to ArticleSearchDAO::insertObject() in OJS 2.4.8 and OJS 3.0.2 clear existing object keywords if they exist.

The function ArticleSearchIndex::_updateTextIndex() calls ArticleSearchDAO::insertObject() in 2.4.8 and 3.0.2.

The function ArticleSearchIndex::_updateTextIndex() is called sequentially with the same arguments in subroutine ArticleSearchIndex::articleFilesChanged() because both ArticleSearchIndex::articleFileChanged() and ArticleSearchIndex::suppFileMetadataChanged() (via _updateTextIndex()) call insertObject() on the same file id.

The result is that the fulltext object keyword relationships for supplemental files are lost.

@ctgraham ctgraham self-assigned this Mar 1, 2017
@ctgraham
Copy link
Collaborator Author

ctgraham commented Mar 2, 2017

Similarly here: https://github.com/pkp/ojs/blob/ojs-stable-2_4_8/classes/submission/form/SuppFileForm.inc.php#L255-L276

My first thought was to add a new constant ARTICLE_SEARCH_SUPPLEMENTARY_FILE_METADATA to ArticleSearch.inc.php, but this would potentially confuse the mapping of ArticleSearch::getIndexFileMap() and dependencies of the use and display of two different search bitvalues mapped to a single search "field"?

An alternate approach is to provide a parameterized flag to ensure calls can avoid clearing existing keyword relationships when adding additional keywords to an object.

@ctgraham
Copy link
Collaborator Author

ctgraham commented Mar 2, 2017

ArticleSearch::_indexObjectKeywords() assumes a empty index, so parameterizing a flag to to avoid clearing existing keywords starts to get messy quickly.

ctgraham added a commit to ulsdevteam/ojs that referenced this issue Mar 6, 2017
asmecher added a commit to pkp/ojs that referenced this issue Mar 9, 2017
…exing

pkp/pkp-lib#2327: Index supplemental file fulltext interdependently with supplemental file metadata
asmecher pushed a commit to pkp/ojs that referenced this issue Mar 9, 2017
@asmecher
Copy link
Member

asmecher commented Mar 9, 2017

Thanks, @ctgraham -- merged and ported to ojs-stable-2_4_8.

@asmecher asmecher closed this as completed Mar 9, 2017
@asmecher asmecher added this to the OJS 2.4.9 milestone Mar 9, 2017
@ctgraham
Copy link
Collaborator Author

ctgraham commented Mar 9, 2017

@asmecher, it looks like forward porting this to 3.x is unnecessary because 3.x doesn't index the metadata for files, only metadata for articles? Am I reading that right in ArticleSearchIndex.inc.php and SubmissionSearchIndex.inc.php?

@asmecher
Copy link
Member

OJS 3.x doesn't include a separate "supplementary files" set, so those are no longer indexed per the code that was problematic here.

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