ajnyga
February 20, 2018, 9:10pm
1
Hi,
I noticed that some of my imported articles are not getting indexed. The reason is that the XML import files have not included the date_submitted date which should be optional: https://github.com/pkp/pkp-lib/blob/master/plugins/importexport/native/pkp-native.xsd#L237
So when date_submitted is not there, the import saves NULL to date_submitted and the article search index is not created for these articles:
* implementation does not support journal-specific re-indexing
* as index data is not partitioned by journal.
* @param $switches array Optional index administration switches.
*/
public function rebuildIndex($log = false, $journal = null, $switches = [])
{
// Check whether a search plug-in jumps in.
$hookResult = HookRegistry::call(
'ArticleSearchIndex::rebuildIndex',
[$log, $journal, $switches]
);
// If no search plug-in is activated then fall back to the
// default database search implementation.
if ($hookResult === false || is_null($hookResult)) {
AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON);
// Check that no journal was given as we do
// not support journal-specific re-indexing.
if (is_a($journal, 'Journal')) {
die(__('search.cli.rebuildIndex.indexingByJournalNotSupported') . "\n");
I will add the date_submitted parameter to my conversion script of course, but is it necessary to check for date_submitted there?
Hi @ajnyga ,
I think date_submitted
is a proxy in this case for ensuring that the submission is “complete”, i.e. it’s not somewhere in the middle of the submission process. A better match would be $article->getSubmissionProgress()
– check that it’s zero (meaning that the submission process is complete). This wouldn’t accidentally exclude articles without submission dates.
Regards,
Alec Smecher
Public Knowledge Project Team
ajnyga
February 22, 2018, 8:33pm
3
Yes that is probably what it is and that is why the having that optional in the XML schema is a bit problematic.
I could do a pr, but I do not know if there is any point when you could just do the change with the same effort as doing a merge?
Hi @ajnyga ,
Committed, thanks!
Regards,
Alec Smecher
Public Knowledge Project Team