Merge pull request #17 from wallermadev/master

Ready for app integration.
This commit is contained in:
Fillerino 2017-09-20 22:17:34 +02:00 committed by GitHub
commit 46278b3807
3 changed files with 35 additions and 34 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
export const port = process.env.PORT || 3000;
export const port = process.env.PORT || 80;
export const baseApi = 'api';

View file

@ -20,22 +20,23 @@ function getResults (input) {
if (input.size === undefined) input.size = 10;
if (input.from === undefined) input.from = 0;
return eclient.search({
index: 'claims',
body : {
'query': {
'bool': {
'must': {
'query_string': {
'query' : input.s.trim(),
'fields': [
'name',
'value.stream.metadata.author',
'value.stream.metadata.title',
'value.stream.metadata.description',
],
},
},
},
index: "claims",
_source: ["name", "value", "claimId"],
body: {
"query": {
"bool": {
"must": {
"query_string": {
"query": '*' + input.s.trim() + '*',
"fields": [
"name",
"value.stream.metadata.author",
"value.stream.metadata.title",
"value.stream.metadata.description"
]
}
}
}
},
size: input.size,
from: input.from,
@ -47,22 +48,22 @@ function getAutoComplete (input) {
if (input.size === undefined) input.size = 10;
if (input.from === undefined) input.from = 0;
return eclient.search({
index : 'claims',
_source: ['name', 'value.stream.metadata.title', 'value.stream.metadata.author'],
body : {
'query': {
'bool': {
'must': {
'query_string': {
'query' : input.s.trim(),
'fields': [
'name',
'value.stream.metadata.title',
'value.stream.metadata.author',
],
},
},
},
index: "claims",
_source: ["name", "value.stream.metadata.title", "value.stream.metadata.author"],
body: {
"query": {
"bool": {
"must": {
"query_string": {
"query": "*" + input.s.trim() + "*",
"fields": [
"name",
"value.stream.metadata.title",
"value.stream.metadata.author"
]
}
}
}
},
size: input.size,
from: input.from,