diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 47bcfba74b732c96f548cfcd0220ed805758ad49..6097f9824fd119e3c56ff1f1f98801d8d1e10a21 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -7,7 +7,6 @@ class CatalogController < ApplicationController end def index - console if params[:q] @user_params = @solr_params = SolrQuery.new.to_params @@ -23,6 +22,8 @@ class CatalogController < ApplicationController end end end + session['search_params'] = @solr_params + session['query_params'] = params.to_unsafe_h.slice('q', 'page', 'per_page','sort', 'f') @results = SolrSearcher.query @solr_params @resulting_docs = @results['response']['docs'].map do |solr_doc| case solr_doc['has_model_ssim'] @@ -32,10 +33,10 @@ class CatalogController < ApplicationController Issue.from_solr_doc solr_doc end end - entities_fields = ["linked_persons_ssim", "linked_locations_ssim", "linked_organisations_ssim", "linked_humanprods_ssim"] + entities_fields = I18n.t("newspapers.solr_fields").values_at(:persons, :locations, :organisations, :human_productions) @entities_labels = [] entities_fields.each do |entity_field| - (@entities_labels << Hash[*@results['facet_counts']['facet_fields'][entity_field]].keys).flatten! + (@entities_labels << @results['facets'][entity_field]['buckets'].map{|ne| ne['val']}).flatten! end @entities_labels = helpers.get_entity_label @entities_labels end @@ -69,7 +70,34 @@ class CatalogController < ApplicationController end def paginate_facets - render partial: 'paginate_facets', locals: {total: params[:total], per_page: params[:per_page], current_page: params[:page]} + out = {} + if params[:field_name] != "" + search_params = session['search_params'] + search_params['rows'] = 0 + search_params['json.facet'] = {"#{params[:field_name]}": {terms: { + field: params[:field_name], + limit: 15, + numBuckets: true, + offset: (params[:current_page].to_i-1) * 15}}}.to_json + res = SolrSearcher.query search_params + entities_labels = [res['facets'][params[:field_name]]['buckets'].map{|ne| ne['val']}] + entities_labels = helpers.get_entity_label entities_labels + facet_constraints = search_params['fq'].select { |fq| fq.split(':')[0] == params[:field_name] }.map{|fq| {label: params[:field_name], value: fq.split(':')[1]} } + out[:facets_entries] = [] + res['facets'][params[:field_name]]['buckets'].each do |facet_entry| + out[:facets_entries] << render_to_string(layout: false, partial: "facet_entry", locals: { + entities_labels: entities_labels, + facet_constraints: facet_constraints, + field: params[:field_name], + facet: facet_entry, + index: params[:current_page].to_i, + per_page: 15 + }) + end + + end + out[:pagination] = render_to_string(layout: false, partial: 'facet_pagination', locals: {nb_pages: params[:nb_pages].to_i, current_page: params[:current_page].to_i}) + render json: out end private diff --git a/app/javascript/packs/controllers/facets_controller.js b/app/javascript/packs/controllers/facets_controller.js index cbe711c728fd09c7799ddf2e33c5656f5e4976a6..35aaa671c4937d73d88a16c43ceb922795fb2207 100644 --- a/app/javascript/packs/controllers/facets_controller.js +++ b/app/javascript/packs/controllers/facets_controller.js @@ -1,126 +1,52 @@ import { Controller } from "stimulus" +import { SearchAPI } from "../utils/search_api" export default class extends Controller { static targets = [ "pageButton", "nextButton", 'previousButton', 'item' ] - static values = { index: Number, pages: Number, perPage: Number } + static values = { index: Number, nbPages: Number, perPage: Number } initialize() { } connect() { - this.generatePagination() + this.generatePagination(false) } previous_page(event) { event.preventDefault() if (this.indexValue > 1) { this.indexValue-- - this.updatePagination() + this.generatePagination() } } next_page(event) { event.preventDefault() - if (this.indexValue < this.pagesValue) + if (this.indexValue < this.nbPagesValue) this.indexValue++ - this.updatePagination() + this.generatePagination() } page_button(event) { + // $(this.element).find("ul.list-unstyled")[0].innerHTML = "<div class=\"spinner-border\"></div>" event.preventDefault() this.indexValue = event.target.textContent - this.updatePagination() - - } - - updatePagination() { - this.itemTargets.forEach( (item, item_index) => { - item.hidden = !(item_index >= ((this.indexValue-1) * this.perPageValue) && item_index < (this.indexValue * this.perPageValue)) - }) this.generatePagination() - } - generatePagination() { - if (this.pagesValue > this.perPageValue) { - const nav = document.createElement('nav') - const ul = document.createElement('ul') - ul.setAttribute('class', 'pagination pagination-sm justify-content-center') - nav.appendChild(ul) - - const prev = document.createElement('li') - prev.setAttribute("data-facets-target", "previousButton") - prev.setAttribute('data-action', "click->facets#previous_page") - prev.setAttribute('class', "page-item") - if (this.indexValue === 1) - prev.classList.add("disabled") - let a = document.createElement("a") - a.setAttribute('class', 'page-link') - a.setAttribute('href', '#') - a.appendChild(document.createTextNode("\u00AB")) - prev.appendChild(a) - ul.appendChild(prev) - - if (this.pagesValue > 10) { - for (let i=1; i <= this.pagesValue; i++) { - if ( (i >= this.indexValue-2 && i <= this.indexValue+2) || i <= 1 || i >= this.pagesValue) { - const pageButton = document.createElement('li') - pageButton.setAttribute("data-facets-target", "pageButton") - pageButton.setAttribute('data-action', "click->facets#page_button") - pageButton.setAttribute('class', "page-item") - if (this.indexValue === i) - pageButton.classList.add("active") - a = document.createElement("a") - a.setAttribute('class', 'page-link') - a.setAttribute('href', '#') - a.appendChild(document.createTextNode(i+"")) - pageButton.appendChild(a) - ul.appendChild(pageButton) - } - else if ( (i === 2 && this.indexValue >= 5) || (i === this.pagesValue-1 && this.indexValue <= this.pagesValue-4) ) { - const skipButton = document.createElement('li') - // skipButton.setAttribute("data-facets-target", "pageButton") - // skipButton.setAttribute('data-action', "click->facets#page_button") - skipButton.setAttribute('class', "page-item disabled") - a = document.createElement("a") - a.setAttribute('class', 'page-link') - a.setAttribute('href', '#') - a.appendChild(document.createTextNode("...")) - skipButton.appendChild(a) - ul.appendChild(skipButton) - } - } - } - else { - for (let i=1; i <= this.pagesValue; i++) { - const pageButton = document.createElement('li') - pageButton.setAttribute("data-facets-target", "pageButton") - pageButton.setAttribute('data-action', "click->facets#page_button") - pageButton.setAttribute('class', "page-item") - if (this.indexValue === i) - pageButton.classList.add("active") - a = document.createElement("a") - a.setAttribute('class', 'page-link') - a.setAttribute('href', '#') - a.appendChild(document.createTextNode(i+"")) - pageButton.appendChild(a) - ul.appendChild(pageButton) - } - } - - const next = document.createElement('li') - next.setAttribute("data-facets-target", "nextButton") - next.setAttribute('data-action', "click->facets#next_page") - next.setAttribute('class', "page-item") - if (this.indexValue === this.pagesValue) - next.classList.add("disabled") - a = document.createElement("a") - a.setAttribute('class', 'page-link') - a.setAttribute('href', '#') - a.appendChild(document.createTextNode("\u00BB")) - next.appendChild(a) - ul.appendChild(next) + } - this.element.querySelector("div.facet_pagination").innerHTML = nav.outerHTML + generatePagination(generateFacets=true) { + if(generateFacets) { + const entity_field = this.element.parentElement.getAttribute('id').substring("facet_collapse_".length) + SearchAPI.facetPagination(entity_field, this.nbPagesValue, this.indexValue, (data) => { + $(this.element).find("ul.list-unstyled")[0].innerHTML = data['facets_entries'].join("") + $(this.element).find(".facet_pagination")[0].innerHTML = data['pagination'] + }) + } + else if(this.nbPagesValue > 1) { + SearchAPI.facetPagination(null, this.nbPagesValue, this.indexValue, (data) => { + $(this.element).find(".facet_pagination")[0].innerHTML = data['pagination'] + }) } } } \ No newline at end of file diff --git a/app/javascript/packs/utils/search_api.js b/app/javascript/packs/utils/search_api.js index 9d80c7d6964b17c179530986ce18da3938504367..259b5f6f52983cd484780046f4f6e7aef1fdb07d 100644 --- a/app/javascript/packs/utils/search_api.js +++ b/app/javascript/packs/utils/search_api.js @@ -34,11 +34,11 @@ export class SearchAPI { }) } - static create_dataset(title, callback) { + static facetPagination(fieldName, nbPages, currentPage, callback) { $.ajax({ type: "POST", - url: "/dataset/create", - data: {title: title}, + url: "/catalog/facet_pagination", + data: {field_name: fieldName, nb_pages: nbPages, current_page: currentPage}, headers: { 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') }, diff --git a/app/models/solr_query.rb b/app/models/solr_query.rb index 21eb6a86377dd32f639e9f3f97f14c1d9a0cf02d..3f771f0efece8e9656c5ba4b35d9e1cfd44e77f0 100644 --- a/app/models/solr_query.rb +++ b/app/models/solr_query.rb @@ -17,7 +17,7 @@ class SolrQuery @fl = '*,score' @q = '*:*' @q_dot_alt = '*:*' - @qf = "all_text_tfr_siv" + @qf = I18n.t("newspapers.solr_fields").select{|k,v| k.start_with? "text_exact" }.values # or text_stemmed @mm = 1 @pf = "" @ps = "" @@ -25,21 +25,25 @@ class SolrQuery @tie = 0.1 @bq = "" @bf = "" - @facet = true - @facet_dot_field = I18n.t("newspapers.solr_fields").values_at(:language, :date, :month, :day, :newspaper, :persons, :locations, :organisations) - I18n.t("newspapers.solr_fields").values_at(:month, :day).each do |field| - self.instance_variable_set("@f_dot_#{field}_dot_facet_dot_sort", 'index') - end - @f_dot_linked_persons_ssim_dot_facet_dot_limit = 10000 - @f_dot_linked_locations_ssim_dot_facet_dot_limit = 10000 - @f_dot_linked_organisations_ssim_dot_facet_dot_limit = 10000 - @facet_dot_threads = 4 @hl = true - @hl_dot_fl = "all_text_tfr_siv" + @hl_dot_fl = @qf + + @json_dot_facet = {} + I18n.t("newspapers.solr_fields").values_at(:language, :date, :newspaper).each do |f| + @json_dot_facet[f] = { terms: { field: f, limit: 15, numBuckets: true} } + end + I18n.t("newspapers.solr_fields").values_at(:month, :day).each do |f| + @json_dot_facet[f] = { terms: { field: f, limit: 15, numBuckets: true, sort: {index: "asc"}} } + end + I18n.t("newspapers.solr_fields").values_at(:persons, :locations, :organisations, :human_productions).each do |f| + @json_dot_facet[f] = { terms: { field: f, limit: 15, numBuckets: true} } + end end def to_params - self.instance_values.select {|k,v| v != ""}.transform_keys{|k| k.gsub('_dot_','.')}.with_indifferent_access + p = self.instance_values.select {|k,v| v != "" and !v.nil?}.transform_keys{|k| k.gsub('_dot_','.')}.with_indifferent_access + p["json.facet"] = p["json.facet"].to_json + p end end \ No newline at end of file diff --git a/app/views/catalog/_facet.html.erb b/app/views/catalog/_facet.html.erb index e5bf55a0a77cfd8a25c535f352cf4d990ae94a2e..fba2a30684fbbb7b937cbdaf6b3df3acc46e71cd 100644 --- a/app/views/catalog/_facet.html.erb +++ b/app/views/catalog/_facet.html.erb @@ -11,16 +11,15 @@ </h2> <div id="facet_collapse_<%= field %>" class="accordion-collapse collapse<%= " show" unless facet_constraints.empty? %>" aria-labelledby="facet_<%= field %>"> <% per_page = 15 %> - <% total = entries.size/2 %> <% nb_pages = (total/per_page.to_f).ceil %> <div class="accordion-body" data-controller="facets" data-facets-index-value="1" - data-facets-pages-value="<%= nb_pages %>" + data-facets-nb-pages-value="<%= nb_pages %>" data-facets-per-page-value="<%= per_page %>"> <ul class="list-unstyled"> - <% entries.each_slice(2).each_with_index do |facet, index| %> - <%= render partial: 'facet_entry', locals: {facet_constraints: facet_constraints, field: field, facet: facet, index: index, per_page: per_page} %> + <% entries.each_with_index do |facet, index| %> + <%= render partial: 'facet_entry', locals: {entities_labels: entities_labels, facet_constraints: facet_constraints, field: field, facet: facet, index: index, per_page: per_page} %> <% end %> </ul> <div class="facet_pagination"></div> diff --git a/app/views/catalog/_facet_entry.html.erb b/app/views/catalog/_facet_entry.html.erb index 50a19c2a7483678bd32d0d2b62f514b411474c2f..00dbf4a48f7b2451c8ab9c6b7602bd290cfa67b5 100644 --- a/app/views/catalog/_facet_entry.html.erb +++ b/app/views/catalog/_facet_entry.html.erb @@ -1,55 +1,55 @@ <% li_classes = "" %> -<% entry_is_selected = facet_constraints.any? {|fc| fc[:value] == facet[0]} %> +<% entry_is_selected = facet_constraints.any? {|fc| fc[:value] == facet['val']} %> <% li_classes = "selected_constraint" if entry_is_selected %> -<li<%= index < per_page ? "" : " hidden" %> data-facets-target="item" class="<%= li_classes %>"> +<li data-facets-target="item" class="<%= li_classes %>"> <% case field %> <% when t("newspapers.solr_fields.newspaper") %> <% if entry_is_selected %> - <%= t("newspapers.titles." + facet[0]) %> + <%= t("newspapers.titles.#{facet['val']}") %> <% else %> - <a href="<%= url_for merge_facets(current_page_params,{f: Hash[field, [facet[0]]] }) %>"> - <%= t("newspapers.titles." + facet[0]) %> + <a href="<%= url_for(controller: 'catalog', **merge_facets(session['query_params'],{f: Hash[field, [facet['val']]] })) %>"> + <%= t("newspapers.titles.#{facet['val']}") %> </a> <% end %> <% when t("newspapers.solr_fields.language") %> <% if entry_is_selected %> - <%= t("newspapers.languages." + facet[0]) %> + <%= t("newspapers.languages.#{facet['val']}") %> <% else %> - <a href="<%= url_for merge_facets(current_page_params,{f: Hash[field, [facet[0]]] }) %>"> - <%= t("newspapers.languages." + facet[0]) %> + <a href="<%= url_for(controller: 'catalog', **merge_facets(session['query_params'],{f: Hash[field, [facet['val']]] })) %>"> + <%= t("newspapers.languages.#{facet['val']}") %> </a> <% end %> <% when t("newspapers.solr_fields.month") %> <% if entry_is_selected %> - <%= t("newspapers.month." + facet[0]) %> + <%= t("newspapers.month.#{facet['val']}") %> <% else %> - <a href="<%= url_for merge_facets(current_page_params,{f: Hash[field, [facet[0]]] }) %>"> - <%= t("newspapers.month." + facet[0]) %> + <a href="<%= url_for(controller: 'catalog', **merge_facets(session['query_params'],{f: Hash[field, [facet['val']]] })) %>"> + <%= t("newspapers.month.#{facet['val']}") %> </a> <% end %> <% when t("newspapers.solr_fields.day") %> <% if entry_is_selected %> - <%= t("newspapers.day." + facet[0]) %> + <%= t("newspapers.day.#{facet['val']}") %> <% else %> - <a href="<%= url_for merge_facets(current_page_params,{f: Hash[field, [facet[0]]] }) %>"> - <%= t("newspapers.day." + facet[0]) %> + <a href="<%= url_for(controller: 'catalog', **merge_facets(session['query_params'],{f: Hash[field, [facet['val']]] })) %>"> + <%= t("newspapers.day.#{facet['val']}") %> </a> <% end %> - <% when t("newspapers.solr_fields.persons") %> + <% when *(I18n.t("newspapers.solr_fields").values_at(:persons, :locations, :organisations, :human_productions)) %> <% if entry_is_selected %> - <%= get_entity_label facet[0] %> + <%= entities_labels[facet['val']] %> <% else %> - <% if current_page_params[:f].nil? or current_page_params[:f][field].nil? %> - <% facet_list = [facet[0]] %> + <% if session['query_params'][:f].nil? or session['query_params'][:f][field].nil? %> + <% facet_list = [facet['val']] %> <% else %> - <% facet_list = current_page_params[:f][field].concat([facet[0]]) %> + <% facet_list = session['query_params'][:f][field] +[facet['val']] %> <% end %> - <a href="<%= url_for merge_facets(current_page_params,{f: Hash[field, facet_list] }) %>"> - <%= get_entity_label facet[0] %> + <a href="<%= url_for(controller: "catalog", **merge_facets(session['query_params'],{f: Hash[field, facet_list] })) %>"> + <%= entities_labels[facet['val']] %> </a> <% end %> <% else %> - <%= facet[0] %> + <%= facet['val'] %> <% end %> - <span class="badge rounded-pill bg-primary float-end"><%= facet[1] %></span> + <span class="badge rounded-pill bg-primary float-end"><%= facet['count'] %></span> </li> \ No newline at end of file diff --git a/app/views/catalog/_facet_pagination.html.erb b/app/views/catalog/_facet_pagination.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..fe7c59df0e0224e8b6350a67501ed2d4d699bf42 --- /dev/null +++ b/app/views/catalog/_facet_pagination.html.erb @@ -0,0 +1,31 @@ +<% if nb_pages > 1 %> + <nav> + <ul class="pagination pagination-sm justify-content-center"> + <li class="page-item<%= " disabled" if current_page == 1 %>" data-facets-target="previousButton" data-action="click->facets#previous_page"> + <a class="page-link" href="#">«</a> + </li> + <% if (nb_pages > 10) %> + <% (1..nb_pages).each do |i| %> + <% if (i >= current_page-2 and i <= current_page+2) or (i <= 1) or (i>= nb_pages) %> + <li class="page-item<%= " active" if current_page == i %>" data-facets-target="pageButton" data-action="click->facets#page_button"> + <a class="page-link" href="#"><%= i %></a> + </li> + <% elsif (i == 2 and current_page >= 5) or (i == nb_pages-1 and current_page <= nb_pages-4) %> + <li class="page-item disabled"> + <a class="page-link" href="#">...</a> + </li> + <% end %> + <% end %> + <% else %> + <% (1..nb_pages).each do |i| %> + <li class="page-item<%= " active" if current_page == i %>" data-facets-target="pageButton" data-action="click->facets#page_button"> + <a class="page-link" href="#"><%= i %></a> + </li> + <% end %> + <% end %> + <li class="page-item<%= " disabled" if current_page == nb_pages %>" data-facets-target="nextButton" data-action="click->facets#next_page"> + <a class="page-link" href="#">»</a> + </li> + </ul> + </nav> +<% end %> \ No newline at end of file diff --git a/app/views/catalog/_facets.html.erb b/app/views/catalog/_facets.html.erb index c88fb1d2cfd2d46769a2258129165df58f424f2c..6d617e719e462f927e6644c2130e3656ded19180 100644 --- a/app/views/catalog/_facets.html.erb +++ b/app/views/catalog/_facets.html.erb @@ -1,8 +1,9 @@ <% all_constraints = search_constraints %> <div class="accordion" id="facets"> - <% @results['facet_counts']['facet_fields'].each do |k,v| %> - <% unless v.empty? %> - <%= render partial: "facet", locals: {field: k, entries: v, all_constraints: all_constraints } %> + <% @results['facets'].each do |k,v| %> + <% next if k == "count" %> + <% unless v['numBuckets'] == 0 %> + <%= render partial: "facet", locals: {field: k, entries: v['buckets'], total: v['numBuckets'], all_constraints: all_constraints, entities_labels: @entities_labels } %> <% end %> <% end %> </div> \ No newline at end of file diff --git a/app/views/catalog/_paginate_facets.html.erb b/app/views/catalog/_paginate_facets.html.erb deleted file mode 100644 index 30a7362f2f6020af0e5aeb39de8e42293328c121..0000000000000000000000000000000000000000 --- a/app/views/catalog/_paginate_facets.html.erb +++ /dev/null @@ -1,43 +0,0 @@ -<% nb_pages = (total/per_page.to_f).ceil %> -<nav data-results-pagination-index-value="<%= current_page %>" - data-results-pagination-pages-value="<%= nb_pages %>"> - <ul class="pagination pagination-sm justify-content-center"> - <% if current_page == 1 %> - <li data-results-pagination-target="previousButton" class="page-item disabled" data-action="click->results-pagination#previous_page"> - <a class="page-link" href="#">«</a> - </li> - <% else %> - <li data-results-pagination-target="previousButton" class="page-item" data-action="click->results-pagination#previous_page"> - <a class="page-link" href="#">«</a> - </li> - <% end %> - <% if nb_pages > 10 %> - <% (1..nb_pages).to_a.each do |i| %> - <% if (i >= current_page-2 and i <= current_page+2) or i <= 1 or i >= nb_pages %> - <li data-results-pagination-target="pageButton" class="page-item<%= (i == current_page) ? " active" : "" %>" data-action="click->results-pagination#page_button"> - <a class="page-link" href="<%= url_for current_page_params.merge({page: i}) %>"><%= i %></a> - </li> - <% elsif (i == 2 and current_page >= 5) or (i == nb_pages-1 and current_page <= nb_pages-4) %> - <li data-results-pagination-target="pageButton" class="page-item disabled"> - <a class="page-link" href="#">...</a> - </li> - <% end %> - <% end %> - <% else %> - <% (1..nb_pages).to_a.each do |i| %> - <li data-results-pagination-target="pageButton" class="page-item<%= (i == current_page) ? " active" : "" %>" data-action="click->results-pagination#page_button"> - <a class="page-link" href="<%= url_for current_page_params.merge({page: i}) %>"><%= i %></a> - </li> - <% end %> - <% end %> - <% if current_page == nb_pages %> - <li data-results-pagination-target="nextButton" class="page-item disabled" data-action="click->results-pagination#next_page"> - <a class="page-link" href="#">»</a> - </li> - <% else %> - <li data-results-pagination-target="nextButton" class="page-item" data-action="click->results-pagination#next_page"> - <a class="page-link" href="#">»</a> - </li> - <% end %> - </ul> -</nav> \ No newline at end of file diff --git a/app/views/catalog/_query_filters.html.erb b/app/views/catalog/_query_filters.html.erb index 637d53ea88bcf6f128df550085dd5f584706278b..9f23c89b726d907e89fa835cc91968f4eab8ae1a 100644 --- a/app/views/catalog/_query_filters.html.erb +++ b/app/views/catalog/_query_filters.html.erb @@ -23,7 +23,7 @@ <%= t("newspapers.month." + constraint[:value]) %> <% when 'day' %> <%= t("newspapers.day." + constraint[:value]) %> - <% when 'persons' %> + <% when 'persons', 'locations', 'organisations', 'human_productions' %> <%= get_entity_label constraint[:value] %> <% else %> <%= "" %> diff --git a/app/views/catalog/_results_list_header.html.erb b/app/views/catalog/_results_list_header.html.erb index 04a3d2ffe3ca4b6875221d969cd6bab4460e50fa..b6701e4c1cb9f731692181ea94c8e182fc97c9c1 100644 --- a/app/views/catalog/_results_list_header.html.erb +++ b/app/views/catalog/_results_list_header.html.erb @@ -2,10 +2,7 @@ <div class="p-2"> Results <%= (@current_page-1)*@solr_params[:rows].to_i+1 %>-<%= [@current_page*@solr_params[:rows].to_i, @results['response']['numFound']].min %> out of <%= @results['response']['numFound'] %>. </div> - <div class="" - id="results_navigation" - data-controller="results-pagination" - data-results-pagination-total-value="<%= @results['response']['numFound'] %>"> + <div id="results_navigation"> <%= render partial: 'paginate_results', locals: {total: @results['response']['numFound'], per_page: @solr_params[:rows].to_f, current_page: @current_page} %> diff --git a/config/locales/newspapers.en.yml b/config/locales/newspapers.en.yml index 3164ac0cd0594a7e7d8e3e0540544e74d87ca5c0..d0573eb7ccb6da2aafa40637f69fb6901eed7877 100644 --- a/config/locales/newspapers.en.yml +++ b/config/locales/newspapers.en.yml @@ -40,6 +40,16 @@ en: ORG: "Organisations" HumanProd: "Human productions" solr_fields: + text_exact_fr: "all_text_unstemmed_tfr_siv" + text_stemmed_fr: "all_text_tfr_siv" + text_exact_en: "all_text_unstemmed_ten_siv" + text_stemmed_en: "all_text_ten_siv" + text_exact_fi: "all_text_unstemmed_tfi_siv" + text_stemmed_fi: "all_text_tfi_siv" + text_exact_de: "all_text_unstemmed_tde_siv" + text_stemmed_de: "all_text_tde_siv" + text_exact_se: "all_text_unstemmed_tse_siv" + text_stemmed_se: "all_text_tse_siv" doc_type: "has_model_ssim" date: "date_created_dtsi" month: "month_isi" diff --git a/config/routes.rb b/config/routes.rb index 4fbbe6ebae6f7254cbef0c00d27f019c1267e220..0ba6b8eca2c151d11e92ae10fdd5db3e51841fd8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ Rails.application.routes.draw do get '/search', to: 'catalog#index' get '/catalog/:id', to: 'catalog#show' - post '/paginate_facets', to: 'catalog#paginate_facets' + post '/catalog/facet_pagination', to: 'catalog#paginate_facets' post '/named_entities', to: 'catalog#named_entities_for_doc' post '/dataset_named_entities', to: 'catalog#named_entities_for_dataset'