Skip to content

Commit

Permalink
Merge pull request #167 from itk-dev/feature/LOOP-992-inconsistent-se…
Browse files Browse the repository at this point in the history
…arch-result-order

LOOP-992: Added fallback sorting of search results
  • Loading branch information
rimi-itk authored Aug 2, 2021
2 parents 78df483 + 331a33e commit d13208b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions config/sync/views.view.os2loop_search_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,30 @@ display:
expose:
label: Title
plugin_id: search_api
changed_1:
id: changed_1
table: search_api_index_os2loop_search_db_index
field: changed
relationship: none
group_type: group
admin_label: 'Changed (fallback)'
order: DESC
exposed: false
expose:
label: ''
plugin_id: search_api
title_1:
id: title_1
table: search_api_index_os2loop_search_db_index
field: title
relationship: none
group_type: group
admin_label: 'Title (fallback)'
order: ASC
exposed: false
expose:
label: ''
plugin_id: search_api
title: Search
header:
result:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public function load() {
'os2loop_shared_profession' => [
'target_id' => $this->getReference('os2loop_profession:Andet')->id(),
],
'created' => (new \DateTimeImmutable('2001-01-01'))->getTimestamp(),
'changed' => (new \DateTimeImmutable('2001-01-03'))->getTimestamp(),
])->save();

// A post with "medicin" in content only.
Expand All @@ -161,6 +163,8 @@ public function load() {
'os2loop_shared_profession' => [
'target_id' => $this->getReference('os2loop_profession:Andet')->id(),
],
'created' => (new \DateTimeImmutable('2001-01-02'))->getTimestamp(),
'changed' => (new \DateTimeImmutable('2001-01-02'))->getTimestamp(),
])->save();
}

Expand Down

0 comments on commit d13208b

Please sign in to comment.