Revert "Make searching saved objects more powerful with query_string (#9870)" (#10239)

This reverts commit 64a03fafd4.
- We should discuss how to solve this within the UI layer first.
This commit is contained in:
CJ Cenizal 2017-02-07 15:42:36 -08:00 committed by GitHub
parent 740fa072db
commit 9074396473
2 changed files with 2 additions and 17 deletions

View file

@ -37,7 +37,6 @@ uiModules.get('apps/management')
const getData = function (filter) {
const services = registry.all().map(function (obj) {
const service = $injector.get(obj.service);
return service.find(filter).then(function (data) {
return {
service: service,

View file

@ -78,12 +78,11 @@ export class SavedObjectLoader {
*/
find(searchString, size = 100) {
let body;
if (searchString) {
body = {
query: {
query_string: {
query: /^\w+$/.test(searchString) ? `${searchString}*` : searchString,
simple_query_string: {
query: searchString + '*',
fields: ['title^3', 'description'],
default_operator: 'AND'
}
@ -99,19 +98,6 @@ export class SavedObjectLoader {
body,
size
})
.catch(err => {
// attempt to mimic simple_query_string, swallow formatting error
if (err.statusCode === 400) {
return {
hits: {
total: 0,
hits: [],
}
};
}
throw err;
})
.then((resp) => {
return {
total: resp.hits.total,