Skip to content

Commit

Permalink
Merge branch 'fix_issue_906' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Aug 25, 2020
2 parents 9d59d8d + 30d6eef commit cfecd84
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/LibreCat/App/Catalogue/Route/search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Performs search for admin.
push @{$p->{cql}}, "status<>deleted";

$p->{sort} = $p->{sort} // h->config->{default_sort_backend};
$p->{facets} = h->config->{facets}->{publication};

$hits = searcher->search('publication', $p);

Expand Down Expand Up @@ -110,6 +111,8 @@ Performs search for reviewer.
my $dep_query = "department=" . cql_escape($department_id);
push @{$p->{cql}}, $dep_query;

$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);
$hits->{modus} = "reviewer_" . $department_id;
$hits->{department_id} = $department_id;
Expand Down Expand Up @@ -154,6 +157,8 @@ Performs search for reviewer.
my $dep_query = "project=" . cql_escape($project_id);
push @{$p->{cql}}, $dep_query;

$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);
$hits->{modus} = "project_reviewer_" . $project_id;
$hits->{project_id} = $project_id;
Expand Down Expand Up @@ -187,6 +192,8 @@ Performs search for data manager.
push @{$p->{cql}}, $dep_query;
$p->{sort} = $p->{sort} // h->config->{default_sort_backend};

$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);
$hits->{modus} = "data_manager_" . $department_id;
$hits->{department_id} = $department_id;
Expand Down Expand Up @@ -231,6 +238,8 @@ publications.
push @{$p->{cql}}, "status<>deleted";
$p->{sort} = $p->{sort} // h->config->{default_sort_backend};

$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);
$hits->{modus} = "delegate_" . $id;
$hits->{delegate_id} = $id;
Expand Down Expand Up @@ -262,6 +271,8 @@ Performs search for user.
if $p->{fmt} and $p->{fmt} eq "autocomplete";
$p->{sort} = $p->{sort} // h->config->{default_sort_backend};

$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);

$hits->{modus} = "user";
Expand Down
1 change: 1 addition & 0 deletions lib/LibreCat/App/Search/Route/person.pm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ get '/person/:id' => sub {
push @{$p->{cql}}, ("person=$id", "status=public");

$p->{limit} = h->config->{maximum_page_size};
$p->{facets} = h->config->{facets}->{publication};

h->log->debug("executing publication->search: " . to_dumper($p));
my $hits = searcher->search('publication', $p);
Expand Down
2 changes: 2 additions & 0 deletions lib/LibreCat/App/Search/Route/publication.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ get "/record" => sub {
push @{$p->{cql}}, "status=public";

$p->{sort} = $p->{sort} // h->config->{default_sort};
$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);

Expand All @@ -99,6 +100,7 @@ get '/embed' => sub {
$p->{sort} = $p->{sort} // h->config->{default_sort};
$p->{start} = params->{start};
$p->{limit} = h->config->{maximum_page_size};
$p->{facets} = h->config->{facets}->{publication};

my $hits = searcher->search('publication', $p);

Expand Down
2 changes: 1 addition & 1 deletion lib/LibreCat/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub search {
sru_sortkeys => $self->_sru_sort($p->{sort}) // '',
limit => $self->_set_limit($p->{limit}),
start => $p->{start} // 0,
aggs => librecat->config->{facets}->{$bag_name} // {},
aggs => $p->{facets} // {},
);

$self->log->debug(
Expand Down

0 comments on commit cfecd84

Please sign in to comment.