Class: DocsController

Inherits:
ApplicationController show all
Includes:
ControllerUtils, FacetsQuery, MultiDataset
Defined in:
app/controllers/docs_controller.rb

Instance Method Summary collapse

Methods included from MultiDataset

#create_all_models, #create_model, #dataspecs_by_name, #get_all_facets, #get_all_field_info, #get_all_searchable_fields, #get_all_truncated_fields, #get_dataspec, #get_model, #loadAllDatasets, #load_everything, #run_all, #use_all_or_some

Methods included from GeneralUtils

#genLink, #getHR, #get_date_index, #get_search_param, #paramMatch?

Methods included from MiscProcess

#gen_class_name, #make_facet_version, #process_pic, #set_name

Methods included from ControllerUtils

#get_total_docs, #page_calc

Methods included from FacetsQuery

#build_facet_filters, #get_all_categories

Methods included from DataspecUtils

#checkIfX, #getFieldDetails, #sortFields

Instance Method Details

#advancedsearchObject


11
12
# File 'app/controllers/docs_controller.rb', line 11

def advancedsearch
end

#descriptionObject


7
8
9
# File 'app/controllers/docs_controller.rb', line 7

def description
  
end

#indexObject


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/docs_controller.rb', line 14

def index
  # Get docs, pages, and count
  pagenum, start = page_calc(params)
  docs = sort_results(start, @all_facets, @dataspecs.first)
  @total_count = get_total_docs 

  # Paginate documents
  @pagination = WillPaginate::Collection.create(pagenum, 30, @total_count) do |pager|
    pager.replace @docs
  end

  # Get facets and documents
  @facets = @docs.response["facets"]
  @docs = @docs.response["hits"]["hits"]
end

#showObject


30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/docs_controller.rb', line 30

def show
  # Figure out if it has facet fields or not
  @dataspec = get_dataspec(@doc)
  @link_type = Hash.new
  set_link_field

  # Get the set of docs that go together
  @docs = ""
  get_matching_set(@doc["_source"])
  
  respond_to do |format|
    format.html
  end
end