now only return feilds needed in application,
Wildcard searches added to allow partial matches.
This commit is contained in:
parent
66fcf4c833
commit
40a5ef384a
3 changed files with 6 additions and 5 deletions
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
||||||
export const port = process.env.PORT || 3000;
|
export const port = process.env.PORT || 80;
|
||||||
export const baseApi = 'api';
|
export const baseApi = 'api';
|
||||||
|
|
|
@ -21,12 +21,13 @@ function getResults(input) {
|
||||||
if(input.from == undefined) input.from = 0;
|
if(input.from == undefined) input.from = 0;
|
||||||
return eclient.search({
|
return eclient.search({
|
||||||
index: "claims",
|
index: "claims",
|
||||||
|
_source: ["name", "value", "claimId"],
|
||||||
body: {
|
body: {
|
||||||
"query": {
|
"query": {
|
||||||
"bool": {
|
"bool": {
|
||||||
"must": {
|
"must": {
|
||||||
"query_string": {
|
"query_string": {
|
||||||
"query": input.s.trim(),
|
"query": '*' + input.s.trim() + '*',
|
||||||
"fields": [
|
"fields": [
|
||||||
"name",
|
"name",
|
||||||
"value.stream.metadata.author",
|
"value.stream.metadata.author",
|
||||||
|
@ -54,7 +55,7 @@ function getAutoComplete(input) {
|
||||||
"bool": {
|
"bool": {
|
||||||
"must": {
|
"must": {
|
||||||
"query_string": {
|
"query_string": {
|
||||||
"query": input.s.trim(),
|
"query": "*" + input.s.trim() + "*",
|
||||||
"fields": [
|
"fields": [
|
||||||
"name",
|
"name",
|
||||||
"value.stream.metadata.title",
|
"value.stream.metadata.title",
|
||||||
|
@ -138,4 +139,4 @@ class LighthouseControllers {
|
||||||
/* eslint-enable no-param-reassign */
|
/* eslint-enable no-param-reassign */
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new LighthouseControllers();
|
export default new LighthouseControllers();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue