Skip to content

Commit

Permalink
MDL-53579 search: Improve solr engine field name
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmerrill committed Apr 7, 2016
1 parent 546c0af commit f6b4ec7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions search/engine/solr/classes/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class document extends \core_search\document {
'indexed' => true
),
// Stores the status of file indexing.
'solr_fileindexedcontent' => array(
'solr_fileindexstatus' => array(
'type' => 'int',
'stored' => true,
'indexed' => true
Expand Down Expand Up @@ -194,7 +194,7 @@ public function export_file_for_engine($file) {
$data['type'] = \core_search\manager::TYPE_FILE;
$data['solr_fileid'] = $file->get_id();
$data['solr_filecontenthash'] = $file->get_contenthash();
$data['solr_fileindexedcontent'] = self::INDEXED_FILE_TRUE;
$data['solr_fileindexstatus'] = self::INDEXED_FILE_TRUE;
$data['title'] = $file->get_filename();

return $data;
Expand Down
10 changes: 5 additions & 5 deletions search/engine/solr/classes/engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ protected function process_document_files($document) {
if ($indexedfile->solr_filecontenthash != $files[$fileid]->get_contenthash()) {
continue;
}
if ($indexedfile->solr_fileindexedcontent == document::INDEXED_FILE_FALSE &&
if ($indexedfile->solr_fileindexstatus == document::INDEXED_FILE_FALSE &&
$this->file_is_indexable($files[$fileid])) {
// This means that the last time we indexed this file, filtering blocked it.
// Current settings say it is indexable, so we will allow it to be indexed.
Expand Down Expand Up @@ -682,7 +682,7 @@ protected function get_indexed_files($document, $start = 0, $rows = 500) {
$query->addField('title');
$query->addField('solr_fileid');
$query->addField('solr_filecontenthash');
$query->addField('solr_fileindexedcontent');
$query->addField('solr_fileindexstatus');

$query->addFilterQuery('{!cache=false}solr_filegroupingid:(' . $document->get('id') . ')');
$query->addFilterQuery('type:' . \core_search\manager::TYPE_FILE);
Expand Down Expand Up @@ -729,7 +729,7 @@ protected function convert_file_results($responsedoc) {
$result->title = $doc->title;
$result->solr_fileid = $doc->solr_fileid;
$result->solr_filecontenthash = $doc->solr_filecontenthash;
$result->solr_fileindexedcontent = $doc->solr_fileindexedcontent;
$result->solr_fileindexstatus = $doc->solr_fileindexstatus;
$out[] = $result;
}

Expand All @@ -752,7 +752,7 @@ protected function add_stored_file($document, $storedfile) {

if (!$this->file_is_indexable($storedfile)) {
// For files that we don't consider indexable, we will still place a reference in the search engine.
$filedoc['solr_fileindexedcontent'] = document::INDEXED_FILE_FALSE;
$filedoc['solr_fileindexstatus'] = document::INDEXED_FILE_FALSE;
$this->add_solr_document($filedoc);
return;
}
Expand Down Expand Up @@ -838,7 +838,7 @@ protected function add_stored_file($document, $storedfile) {
}

// If we get here, the document was not indexed due to an error. So we will index just the base info without the file.
$filedoc['solr_fileindexedcontent'] = document::INDEXED_FILE_ERROR;
$filedoc['solr_fileindexstatus'] = document::INDEXED_FILE_ERROR;
$this->add_solr_document($filedoc);
}

Expand Down

0 comments on commit f6b4ec7

Please sign in to comment.