tethys/resources/assets/js/search/search-results/search-api.js
Arno Kaimbacher c91a487b98 - remove glyphicons- fonts
- add local open sans
- reactive solr search
- display flex for same height of columns
- add .babelrec
- add reactivesearch-vue components
2020-06-10 21:09:24 +02:00

18 lines
562 B
JavaScript

import axios from "axios";
export default {
async search (term) {
// solr endpoint
const host = 'http://voyagerdemo.com/';
const path = 'daily/solr/v0/select';
const fields = 'id,name:[name],thumb:[thumbURL],abstract,description'; // fields we want returned
const api = `${host}${path}?q=${term}&fl=${fields}&wt=json&rows=20`;
const res = await axios.get(api);
// const call = await fetch(api);
// const json = await res.json();
return res.data.response.docs;
}
}