1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class SearchController < ApplicationController
6 skip_before_action :ensure_arvados_api_exists
8 def find_objects_for_index
10 if params[:project_uuid]
11 # Special case for "search all things in project":
12 @filters = @filters.select do |attr, operator, operand|
13 not (attr == 'owner_uuid' and operator == '=')
15 # Special case for project_uuid is a user uuid:
16 if ArvadosBase::resource_class_for_uuid(params[:project_uuid]) == User
17 search_what = User.find params[:project_uuid]
19 search_what = Group.find params[:project_uuid]
22 @objects = search_what.contents(limit: @limit,
26 last_object_class: params["last_object_class"],
31 def next_page_href with_params={}
32 super with_params.merge(last_object_class: @objects.last.class.to_s,
33 project_uuid: params[:project_uuid],
36 filters: @filters.to_json)