- combined edismax and dismax search

- edismax for searching everything
This commit is contained in:
Arno Kaimbacher 2019-10-18 17:49:02 +02:00
parent b7abdd83e2
commit a2967b90ee
4 changed files with 16 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -31,12 +31,19 @@ export default {
"subject"].toString();
var limit = "&rows=" + SOLR_CONFIG["limit"];
// var limit = solrConfig.limit;
var params = "fl=" + fields + "&defType=edismax&wt=json&indent=on";
var dismaxFields = "title^3 abstract^2 subject^1";
var params = "fl=" + fields;
if (term == "*%3A*") {
params += "&defType=edismax&wt=json&indent=on"; //edismax
} else {
params += "&defType=dismax&qf=" + dismaxFields + "&wt=json&indent=on"; //dismax
}
if (start === undefined) start = "0";
start = "&start=" + start;
//const dismaxFields = "title^3 abstract^2 subject^1";
const facetFields = "&facet=on&facet.field=language&facet.field={!key=datatype}doctype&facet.field=subject";//&fq=year:(2019)";//&facet.query=year:2018";
var filterFields = "";

View File

@ -19,6 +19,7 @@ export default class VsPagination extends Vue {
let from = (page * this.data.per_page) - this.data.per_page;
this.$emit('paginate', from);
}
get numberOfPages() {
return Math.ceil(this.data.total / this.data.per_page);
}

View File

@ -4,22 +4,22 @@
<!-- Previous Page Link -->
<li v-if="data.current_page > 1">
<a class="pagination-previous" href="#" rel="prev" v-on:click.prevent="changePage(data.current_page - 1)">&laquo;</a>
<a class="pagination-previous" href="javascript:void(0)" rel="prev" v-on:click.prevent="changePage(data.current_page - 1)">&laquo;</a>
</li>
<li v-else>
<a class="pagination-previous disabled" disabled href="#" rel="prev">&laquo;</a>
<a class="pagination-previous disabled" disabled href="javascript:void(0)" rel="prev">&laquo;</a>
</li>
<li v-for="(page, index) in pages" :key="index" >
<a href="#" v-on:click.prevent="changePage(page)" v-bind:class="['pagination-link', page == data.current_page ? 'is-current' : '']">{{ page }}</a>
<a href="javascript:void(0)" v-on:click.prevent="changePage(page)" v-bind:class="['pagination-link', page == data.current_page ? 'is-current' : '']">{{ page }}</a>
</li>
<!-- Previous Page Link -->
<li v-if="data.current_page < numberOfPages">
<a class="pagination-next" href="#" v-on:click.prevent="changePage(data.current_page + 1)" rel="next">&raquo;</a>
<a class="pagination-next" href="javascript:void(0)" v-on:click.prevent="changePage(data.current_page + 1)" rel="next">&raquo;</a>
</li>
<li v-else>
<a class="pagination-next disabled" disabled href="#" rel="next">&raquo;</a>
<a class="pagination-next disabled" disabled href="javascript:void(0)" rel="next">&raquo;</a>
</li>
</ul>