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

Bugfix stable 3 3 0 10111 fix search result #718

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions classes/search/ArticleSearch.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ function getSparseArray($unorderedResults, $orderBy, $orderDir, $exclude) {
// Calculate a well-ordered (unique) score.
$resultCount = count($unorderedResults);
$i = 0;
foreach ($unorderedResults as $submissionId => &$data) {
// Reference is necessary to permit modification
$data['score'] = ($resultCount * $data['count']) + $i++;
foreach ($unorderedResults as $submissionId => $data) {
$data[$submissionId]['score'] = ($resultCount * $data['count']) + $i++;
}

// If we got a primary sort order then apply it and use score as secondary
Expand Down Expand Up @@ -210,7 +209,7 @@ function getKeywordsFromSearchFilters($searchFilters) {
$indexFieldMap[SUBMISSION_SEARCH_INDEX_TERMS] = 'indexTerms';
$keywords = array();
if (isset($searchFilters['query'])) {
$keywords[null] = $searchFilters['query'];
$keywords[''] = $searchFilters['query'];
}
foreach($indexFieldMap as $bitmap => $searchField) {
if (isset($searchFilters[$searchField]) && !empty($searchFilters[$searchField])) {
Expand Down
Loading