- combined edismax and dismax search
- edismax for searching everything
This commit is contained in:
parent
b7abdd83e2
commit
a2967b90ee
File diff suppressed because one or more lines are too long
|
@ -31,12 +31,19 @@ export default {
|
||||||
"subject"].toString();
|
"subject"].toString();
|
||||||
var limit = "&rows=" + SOLR_CONFIG["limit"];
|
var limit = "&rows=" + SOLR_CONFIG["limit"];
|
||||||
// var limit = solrConfig.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";
|
if (start === undefined) start = "0";
|
||||||
start = "&start=" + start;
|
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";
|
const facetFields = "&facet=on&facet.field=language&facet.field={!key=datatype}doctype&facet.field=subject";//&fq=year:(2019)";//&facet.query=year:2018";
|
||||||
|
|
||||||
var filterFields = "";
|
var filterFields = "";
|
||||||
|
|
|
@ -19,6 +19,7 @@ export default class VsPagination extends Vue {
|
||||||
let from = (page * this.data.per_page) - this.data.per_page;
|
let from = (page * this.data.per_page) - this.data.per_page;
|
||||||
this.$emit('paginate', from);
|
this.$emit('paginate', from);
|
||||||
}
|
}
|
||||||
|
|
||||||
get numberOfPages() {
|
get numberOfPages() {
|
||||||
return Math.ceil(this.data.total / this.data.per_page);
|
return Math.ceil(this.data.total / this.data.per_page);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,22 +4,22 @@
|
||||||
|
|
||||||
<!-- Previous Page Link -->
|
<!-- Previous Page Link -->
|
||||||
<li v-if="data.current_page > 1">
|
<li v-if="data.current_page > 1">
|
||||||
<a class="pagination-previous" href="#" rel="prev" v-on:click.prevent="changePage(data.current_page - 1)">«</a>
|
<a class="pagination-previous" href="javascript:void(0)" rel="prev" v-on:click.prevent="changePage(data.current_page - 1)">«</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-else>
|
<li v-else>
|
||||||
<a class="pagination-previous disabled" disabled href="#" rel="prev">«</a>
|
<a class="pagination-previous disabled" disabled href="javascript:void(0)" rel="prev">«</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li v-for="(page, index) in pages" :key="index" >
|
<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>
|
</li>
|
||||||
|
|
||||||
<!-- Previous Page Link -->
|
<!-- Previous Page Link -->
|
||||||
<li v-if="data.current_page < numberOfPages">
|
<li v-if="data.current_page < numberOfPages">
|
||||||
<a class="pagination-next" href="#" v-on:click.prevent="changePage(data.current_page + 1)" rel="next">»</a>
|
<a class="pagination-next" href="javascript:void(0)" v-on:click.prevent="changePage(data.current_page + 1)" rel="next">»</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-else>
|
<li v-else>
|
||||||
<a class="pagination-next disabled" disabled href="#" rel="next">»</a>
|
<a class="pagination-next disabled" disabled href="javascript:void(0)" rel="next">»</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user