Skip to content
Snippets Groups Projects
Commit 132651d2 authored by Mike Lynch's avatar Mike Lynch
Browse files

elasticsearch queries are getting through the webpack dev proxy

parent 348e1e36
Branches
No related merge requests found
{ {
"repo": "http://localhost:8080/repo/", "repo": "http://localhost:8080/repo/",
"core": "repo", "core": "repo",
"api": "/solr/ocflcore", "api": "/_search",
"dev": { "dev": {
"proxy": { "proxy": {
"/solr/ocflcore": { "/_search": {
"target": "http://localhost:8080", "target": "http://localhost:9200/ocfl/_search",
"secure": false "secure": false,
"logLevel": "debug"
} }
} }
} }
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ const ViewDoc = require('./views/ViewDoc'); ...@@ -8,7 +8,7 @@ const ViewDoc = require('./views/ViewDoc');
const ViewError = require('./views/ViewError'); const ViewError = require('./views/ViewError');
const FacetController = require('./FacetController'); const FacetController = require('./FacetController');
const solrService = require('./SolrService'); const elasticService = require('./ElasticService');
const Router = async function (state) { const Router = async function (state) {
const route = window.location.hash; const route = window.location.hash;
...@@ -27,7 +27,7 @@ const Router = async function (state) { ...@@ -27,7 +27,7 @@ const Router = async function (state) {
//Removing orcid.org to have better matches //Removing orcid.org to have better matches
state.main.doc.id = state.main.doc.id.replace("http://orcid.org/0000-000", ""); state.main.doc.id = state.main.doc.id.replace("http://orcid.org/0000-000", "");
//state.main.doc.id = encodeURIComponent(state.main.doc.id); //state.main.doc.id = encodeURIComponent(state.main.doc.id);
const res = await solrService.search({api: state.config.api}, { const res = await elasticService.search({api: state.config.api}, {
start: 0, start: 0,
page: 1, page: 1,
searchParam: 'author_id%3A', searchParam: 'author_id%3A',
...@@ -49,7 +49,7 @@ const Router = async function (state) { ...@@ -49,7 +49,7 @@ const Router = async function (state) {
const start = splits[0] || state.main.start; const start = splits[0] || state.main.start;
const page = splits[1] || ''; const page = splits[1] || '';
let searchText = splits[2] || ''; let searchText = splits[2] || '';
const {data, status} = await solrService.search({api: state.config.api}, { const {data, status} = await elasticService.search({api: state.config.api}, {
start: start, start: start,
page: page, page: page,
searchParam: 'main_search%3A', searchParam: 'main_search%3A',
...@@ -72,7 +72,7 @@ const Router = async function (state) { ...@@ -72,7 +72,7 @@ const Router = async function (state) {
} }
} else { } else {
// TODO: Move some of these config data to config // TODO: Move some of these config data to config
const res = await solrService.search({api: state.config.api}, { const res = await elasticService.search({api: state.config.api}, {
start: state.main.start, start: state.main.start,
page: state.main.page, page: state.main.page,
searchParam: '*%3A', searchParam: '*%3A',
......
...@@ -39,7 +39,7 @@ let state = { ...@@ -39,7 +39,7 @@ let state = {
viewFields: [ viewFields: [
{display: "SubDocHorizontal", field: "author", fieldName: 'Author/s'}, {display: "SubDocHorizontal", field: "author", fieldName: 'Author/s'},
//{display: "", field: "affiliation", fieldName: 'Affiliation'}, //{display: "", field: "affiliation", fieldName: 'Affiliation'},
{display: "", field: "license", fieldName: 'Licence'}, {display: "", field: "licenseOriginal", fieldName: 'Licence'},
{display: "SubDocDate", field: "datePublished", fieldName: 'Date Published'}, {display: "SubDocDate", field: "datePublished", fieldName: 'Date Published'},
{display: "SubDoc", field: "contactPoint", fieldName: 'Contact Point', template: '${item.name} ${item.email}'}, {display: "SubDoc", field: "contactPoint", fieldName: 'Contact Point', template: '${item.name} ${item.email}'},
] ]
......
...@@ -34,7 +34,8 @@ module.exports = { ...@@ -34,7 +34,8 @@ module.exports = {
proxy: config.dev.proxy, proxy: config.dev.proxy,
historyApiFallback: { historyApiFallback: {
index: 'index.html' index: 'index.html'
} },
clientLogLevel: 'debug'
}, },
module: { module: {
rules: [ rules: [
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment