You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wi...@apache.org on 2019/09/25 12:58:14 UTC

[couchdb-fauxton] 02/02: Add Search support

This is an automated email from the ASF dual-hosted git repository.

willholley pushed a commit to branch search_addon
in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git

commit 7b2bbfc0bab8d9ddb5853b2e289c052967376037
Author: Will Holley <wi...@gmail.com>
AuthorDate: Tue Sep 24 15:42:27 2019 +0100

    Add Search support
    
    Adds a search module to Fauxton. The functionality is only enabled
    upon detection of "search" in the reported CouchDB features.
    
    When enabled, it adds:
     * New dropdown options to create/update search indexes in the sidebar
     * New panel to run search queries from the sidebar
     * Text index templates to the Mango Index editor
---
 .../documents/assets/less/query-options.less       |   4 +-
 app/addons/search/__tests__/components.test.js     |  22 ++--
 app/addons/search/__tests__/search.actions.test.js |  21 ++--
 .../search/__tests__/search.reducers.test.js       |  21 ++--
 app/addons/search/actions.js                       |  21 ++--
 app/addons/search/actiontypes.js                   |  22 ++--
 app/addons/search/api.js                           |  23 ++--
 app/addons/search/assets/less/search.less          |  25 +++--
 app/addons/search/base.js                          | 123 +++++++++------------
 app/addons/search/components/Analyzer.js           |  21 ++--
 app/addons/search/components/AnalyzerDropdown.js   |  21 ++--
 app/addons/search/components/AnalyzerMultiple.js   |  21 ++--
 app/addons/search/components/AnalyzerRow.js        |  21 ++--
 app/addons/search/components/SearchForm.js         |  21 ++--
 app/addons/search/components/SearchIndexEditor.js  |  21 ++--
 app/addons/search/constants.js                     |  80 ++++++++++++--
 app/addons/search/layout.js                        |  21 ++--
 app/addons/search/reducers.js                      |  47 +++++---
 app/addons/search/resources.js                     |  22 ++--
 app/addons/search/routes.js                        |  97 +++-------------
 .../search/tests/nightwatch/cloneSearchIndex.js    |  22 ----
 .../search/tests/nightwatch/createNewSearch.js     |  21 ++--
 .../search/tests/nightwatch/deleteSearchIndex.js   |  22 ----
 .../search/tests/nightwatch/searchPageApiBar.js    |  21 ++--
 app/addons/search/tests/nightwatch/sharedSearch.js |  21 ++--
 assets/less/fauxton.less                           |   9 ++
 package-lock.json                                  |  91 +++++----------
 settings.json.default.json                         |   1 +
 webpack.config.dev.js                              |   2 +-
 29 files changed, 403 insertions(+), 482 deletions(-)

diff --git a/app/addons/documents/assets/less/query-options.less b/app/addons/documents/assets/less/query-options.less
index 2caa9b3..eea473d 100644
--- a/app/addons/documents/assets/less/query-options.less
+++ b/app/addons/documents/assets/less/query-options.less
@@ -108,7 +108,7 @@
     .btn.active {
       background: #fff;
       color: @linkColorHover;
-      box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.25) inset, 2px 2px 2px rgba(0, 0, 0, 0.15);
+      box-shadow: none;
     }
     label:first-child {
       .border-radius(5px 0 0 5px);
@@ -174,7 +174,7 @@
   .hide {
     display: none;
   }
-  
+
   .additionalParams {
     margin-bottom: 2px;
   }
diff --git a/app/addons/search/__tests__/components.test.js b/app/addons/search/__tests__/components.test.js
index 6bb6f39..4d053d5 100644
--- a/app/addons/search/__tests__/components.test.js
+++ b/app/addons/search/__tests__/components.test.js
@@ -1,14 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 import {mount} from 'enzyme';
 import React from 'react';
 import sinon from 'sinon';
diff --git a/app/addons/search/__tests__/search.actions.test.js b/app/addons/search/__tests__/search.actions.test.js
index 99edd28..7765521 100644
--- a/app/addons/search/__tests__/search.actions.test.js
+++ b/app/addons/search/__tests__/search.actions.test.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import sinon from 'sinon';
 import utils from '../../../../test/mocha/testUtils';
diff --git a/app/addons/search/__tests__/search.reducers.test.js b/app/addons/search/__tests__/search.reducers.test.js
index f08d269..1705b2a 100644
--- a/app/addons/search/__tests__/search.reducers.test.js
+++ b/app/addons/search/__tests__/search.reducers.test.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import reducer from '../reducers';
 import ActionTypes from '../actiontypes';
diff --git a/app/addons/search/actions.js b/app/addons/search/actions.js
index 82ac0f1..12d8d6e 100644
--- a/app/addons/search/actions.js
+++ b/app/addons/search/actions.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import FauxtonAPI from '../../core/api';
 import ActionTypes from './actiontypes';
diff --git a/app/addons/search/actiontypes.js b/app/addons/search/actiontypes.js
index c5bbb93..c99abad 100644
--- a/app/addons/search/actiontypes.js
+++ b/app/addons/search/actiontypes.js
@@ -1,13 +1,15 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
 export default {
   SEARCH_INDEX_DESIGN_DOCS_LOADED: 'SEARCH_INDEX_DESIGN_DOCS_LOADED',
   SEARCH_INDEX_INIT: 'SEARCH_INDEX_INIT',
diff --git a/app/addons/search/api.js b/app/addons/search/api.js
index cbfdbcd..5711c98 100644
--- a/app/addons/search/api.js
+++ b/app/addons/search/api.js
@@ -1,19 +1,20 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import FauxtonAPI from '../../core/api';
 import { get } from '../../core/ajax';
 
 function searchUrl(database, partitionKey, ddoc, index, searchQuery) {
-  //https://[username].cloudant.com/animaldb/_design/views101/_search/animals?q=kookaburra
+  //https://mycouchdb/db/_design/views101/_search/animals?q=kookaburra
   const encodedPartKey = partitionKey ? encodeURIComponent(partitionKey) : '';
   return FauxtonAPI.urls('search', 'server', encodeURIComponent(database), encodedPartKey,
     encodeURIComponent(ddoc), encodeURIComponent(index),
diff --git a/app/addons/search/assets/less/search.less b/app/addons/search/assets/less/search.less
index 68c7589..9725d55 100644
--- a/app/addons/search/assets/less/search.less
+++ b/app/addons/search/assets/less/search.less
@@ -1,15 +1,16 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-@import "../../../style/assets/less/variables.less";
-@import "../../../style/assets/less/mixins.less";
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+@import "../../../../../assets/less/bootstrap/mixins.less";
+@import "../../../../../assets/less/variables.less";
 
 .search-index-page-loading {
   margin-top: 20px;
diff --git a/app/addons/search/base.js b/app/addons/search/base.js
index 483b8b9..0562256 100644
--- a/app/addons/search/base.js
+++ b/app/addons/search/base.js
@@ -1,89 +1,66 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-import app from '../../app';
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 import Helpers from '../../helpers';
 import FauxtonAPI from '../../core/api';
 import Actions from './actions';
 import SearchRoutes from './routes';
-import CloudantDocuments from '../cloudantdocuments/routes';
 import reducers from './reducers';
+import { get } from "../../core/ajax";
+import Constants from './constants';
 import './assets/less/search.less';
 
-SearchRoutes.initialize = function () {
-  FauxtonAPI.registerExtension('sidebar:list', {
-    selector: 'indexes',
-    name: 'Search Indexes',
-    urlNamespace: 'search',
-    indexLabel: 'search index', // used for labels
-    onDelete: Actions.deleteSearchIndex,
-    onClone: Actions.cloneSearchIndex,
-    onEdit: Actions.gotoEditSearchIndexPage
-  });
-  FauxtonAPI.registerExtension('sidebar:links', {
-    title: "New Search Index",
-    url: "new_search",
-    icon: 'fonticon-plus-circled',
-    showForPartitionedDDocs: true
-  });
-  FauxtonAPI.registerExtension('sidebar:newLinks', {
-    url: 'new_search',
-    name: 'Search Index'
+function checkSearchFeature () {
+  // Checks if the CouchDB server supports Search
+  return get(Helpers.getServerUrl("/")).then((couchdb) => {
+    return couchdb.features && couchdb.features.includes('search');
+  }).catch(() => {
+    return false;
   });
-
-  // this tells Fauxton of the new Search Index type. It's used to determine when a design doc is really empty
-  FauxtonAPI.registerExtension('IndexTypes:propNames', 'indexes');
-};
+}
 
 function partitionUrlComponent(partitionKey) {
   return partitionKey ? '/_partition/' + partitionKey : '';
 }
 
-var proxyUrl = CloudantDocuments.proxyUrl;
-_.extend(CloudantDocuments.sharedUrlPaths, {
-  search: {
-    server: function (db, partitionKey, designDoc, searchName, query) {
-      query = CloudantDocuments.addRemoteAccount(query);
-      return proxyUrl + db + '/_design/' + designDoc + '/_search/' + searchName + query;
-    },
-
-    //NOTE: partitionKey is included here for compatibility with base registered url functions
-    //but is ignored because it's not supported for shared databases
-    app: function (id, designDoc) {
-      return CloudantDocuments.sharedUrlPaths.userHash() + id + '/_design/' + app.utils.safeURLName(designDoc) + '/_search/';
-    },
-
-    edit: function (database, partitionKey, designDoc, indexName) {
-      return CloudantDocuments.sharedUrlPaths.userHash() + database + '/_design/' + designDoc + '/_search/' + indexName + '/edit';
-    },
-
-    apiurl: function (db, partitionKey, designDoc, searchName) {
-      return CloudantDocuments.sharedUrlPaths.host() + encodeURIComponent(db) + '/_design/' +
-        encodeURIComponent(designDoc) + '/_search/' + encodeURIComponent(searchName);
-    },
-
-    fragment: function (id, partitionKey, designDoc, search) {
-      return CloudantDocuments.sharedUrlPaths.userHash() + id + '/_design/' + designDoc + '/_search/' + search;
-    },
-
-    showIndex: function (id, partitionKey, designDoc, search) {
-      return CloudantDocuments.sharedUrlPaths.host() + id + '/' + designDoc +
-        '/_search/' + search;
-    },
-  },
-  partitioned_search: {
-    app: function (id, partitionKey, designDoc) {
-      return CloudantDocuments.sharedUrlPaths.userHash() + id + '/_design/' + app.utils.safeURLName(designDoc) + '/_search/';
-    }
-  }
-});
+SearchRoutes.initialize = function () {
+  checkSearchFeature().then(function(enabled) {
+    if (!enabled) return;
+
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector: 'indexes',
+      name: 'Search Indexes',
+      urlNamespace: 'search',
+      indexLabel: 'search index', // used for labels
+      onDelete: Actions.deleteSearchIndex,
+      onClone: Actions.cloneSearchIndex,
+      onEdit: Actions.gotoEditSearchIndexPage
+    });
+    FauxtonAPI.registerExtension('sidebar:links', {
+      title: "New Search Index",
+      url: "new_search",
+      icon: 'fonticon-plus-circled',
+      showForPartitionedDDocs: true
+    });
+    FauxtonAPI.registerExtension('sidebar:newLinks', {
+      url: 'new_search',
+      name: 'Search Index'
+    });
+
+    // this tells Fauxton of the new Search Index type. It's used to determine when a design doc is really empty
+    FauxtonAPI.registerExtension('IndexTypes:propNames', 'indexes');
+
+    FauxtonAPI.registerExtension('mango:indexTemplates', Constants.SEARCH_MANGO_INDEX_TEMPLATES);
+  });
+};
 
 FauxtonAPI.registerUrls('partitioned_search', {
   app: function (id, partitionKey, designDoc) {
diff --git a/app/addons/search/components/Analyzer.js b/app/addons/search/components/Analyzer.js
index 78c8a3c..6cd0683 100644
--- a/app/addons/search/components/Analyzer.js
+++ b/app/addons/search/components/Analyzer.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import PropTypes from 'prop-types';
 import React from 'react';
diff --git a/app/addons/search/components/AnalyzerDropdown.js b/app/addons/search/components/AnalyzerDropdown.js
index 88ac8e5..fa28612 100644
--- a/app/addons/search/components/AnalyzerDropdown.js
+++ b/app/addons/search/components/AnalyzerDropdown.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import PropTypes from 'prop-types';
 import React from 'react';
diff --git a/app/addons/search/components/AnalyzerMultiple.js b/app/addons/search/components/AnalyzerMultiple.js
index 6aa4785..43faa9d 100644
--- a/app/addons/search/components/AnalyzerMultiple.js
+++ b/app/addons/search/components/AnalyzerMultiple.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import FauxtonAPI from '../../../core/api';
 import PropTypes from 'prop-types';
diff --git a/app/addons/search/components/AnalyzerRow.js b/app/addons/search/components/AnalyzerRow.js
index c8ca8d1..124bc38 100644
--- a/app/addons/search/components/AnalyzerRow.js
+++ b/app/addons/search/components/AnalyzerRow.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import PropTypes from 'prop-types';
 import React from 'react';
diff --git a/app/addons/search/components/SearchForm.js b/app/addons/search/components/SearchForm.js
index 9a85be1..31a183f 100644
--- a/app/addons/search/components/SearchForm.js
+++ b/app/addons/search/components/SearchForm.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import PropTypes from 'prop-types';
 import React from 'react';
diff --git a/app/addons/search/components/SearchIndexEditor.js b/app/addons/search/components/SearchIndexEditor.js
index 3135ad3..dbff53a 100644
--- a/app/addons/search/components/SearchIndexEditor.js
+++ b/app/addons/search/components/SearchIndexEditor.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 
 import FauxtonAPI from '../../../core/api';
 import app from '../../../app';
diff --git a/app/addons/search/constants.js b/app/addons/search/constants.js
index 408a988..432e301 100644
--- a/app/addons/search/constants.js
+++ b/app/addons/search/constants.js
@@ -1,18 +1,76 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 export default {
   ANALYZER_SINGLE: 'single',
   ANALYZER_MULTIPLE: 'multiple',
   DEFAULT_SEARCH_INDEX_NAME: 'newSearch',
   DEFAULT_ANALYZER_TYPE: 'single',
   DEFAULT_ANALYZER: 'standard',
-  DEFAULT_SEARCH_INDEX_FUNCTION: 'function (doc) {\n  index("name", doc.name);\n}'
+  DEFAULT_SEARCH_INDEX_FUNCTION: 'function (doc) {\n  index("name", doc.name);\n}',
+  SEARCH_MANGO_INDEX_TEMPLATES: [{
+    label: 'Single field (json)',
+    code: {
+      "index": {
+        "fields": ["foo"]
+      },
+      "name": "foo-json-index",
+      "type": "json"
+    }
+  }, {
+    label: 'Multiple fields (json)',
+    code: {
+      "index": {
+        "fields": ["foo", "bar"]
+      },
+      "name": "foo-bar-json-index",
+      "type": "json"
+    }
+  },
+  {
+    label: 'Single field (text)',
+    code: {
+      "index": {
+        "fields": [
+          {
+            "name": "foo",
+            "type": "string"
+          }
+        ]
+      },
+      "name": "foo-text",
+      "type": "text"
+    }
+  },
+  {
+    label: 'All fields (text)',
+    code: {
+      "index": {
+        "default_field": {
+          "enabled": false
+        },
+        "index_array_lengths": false
+      },
+      "name": "all-text",
+      "type": "text"
+    }
+  },
+  {
+    label: 'All fields with default field (text)',
+    code: {
+      "index": {
+        "index_array_lengths": false
+      },
+      "name": "all-text",
+      "type": "text"
+    }
+  }]
 };
diff --git a/app/addons/search/layout.js b/app/addons/search/layout.js
index fb41a92..607627a 100644
--- a/app/addons/search/layout.js
+++ b/app/addons/search/layout.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 import PropTypes from 'prop-types';
 import React from 'react';
 import {TabsSidebarHeader} from '../documents/layouts';
diff --git a/app/addons/search/reducers.js b/app/addons/search/reducers.js
index 12f27b5..9df4fd4 100644
--- a/app/addons/search/reducers.js
+++ b/app/addons/search/reducers.js
@@ -1,15 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-
-import StyleHelpers from '../style/helpers';
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 import ActionTypes from './actiontypes';
 import Constants from './constants';
 import SearchResources from './resources';
@@ -26,6 +25,20 @@ const initialState = {
   ...softReset()
 };
 
+var keys = [];
+function getUniqueKey() {
+  function keygen () {
+    return Math.random().toString(36).substring(7);
+  }
+
+  var newKey = keygen();
+  while (keys.includes(newKey)) {
+    newKey = keygen();
+  }
+  keys.push(newKey);
+  return newKey;
+}
+
 // called on first load (e.g. editing a search index) and every time the create search index page loads
 function softReset() {
   return {
@@ -49,7 +62,7 @@ function softReset() {
 function addAnalyzerRow (state, { analyzer, fieldName }) {
   const newAnalyzerFields = state.analyzerFields.slice();
   newAnalyzerFields.push({
-    key: StyleHelpers.getUniqueKey(),
+    key: getUniqueKey(),
     fieldName: (fieldName) ? fieldName : '',
     analyzer: analyzer,
     valid: (fieldName && fieldName.trim().length > 0)
@@ -101,7 +114,7 @@ function initEditSearch (state, { database, designDocs, ddocInfo, indexName }) {
   if (analyzer && analyzer.fields) {
     Object.keys(analyzer.fields).forEach(fieldName => {
       newAnalyzerFields.push({
-        key: StyleHelpers.getUniqueKey(),
+        key: getUniqueKey(),
         fieldName: (fieldName) ? fieldName : '',
         analyzer: analyzer.fields[fieldName],
         valid: !_.isUndefined(fieldName) && !_.isEmpty(fieldName)
@@ -142,14 +155,16 @@ export function getSaveDesignDoc (state, isDbPartitioned) {
   }
 
   const foundDoc = state.designDocs.find((ddoc) => {
-    return ddoc.id === state.ddocName;
+    return ddoc.id === state.ddocName ||
+      ddoc.id === '_design/' + state.ddocName;
   });
   return (!foundDoc) ? null : foundDoc.dDocModel();
 }
 
 export function getSelectedDesignDocPartitioned(state, isDbPartitioned) {
   const designDoc = state.designDocs.find(ddoc => {
-    return state.ddocName === ddoc.id;
+    return ddoc.id === state.ddocName ||
+      ddoc.id === '_design/' + state.ddocName;
   });
   if (designDoc) {
     return DocumentsHelpers.isDDocPartitioned(designDoc.get('doc'), isDbPartitioned);
diff --git a/app/addons/search/resources.js b/app/addons/search/resources.js
index c653fbb..34d2eaa 100644
--- a/app/addons/search/resources.js
+++ b/app/addons/search/resources.js
@@ -1,14 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 import Constants from './constants';
 import Documents from '../documents/resources';
 
diff --git a/app/addons/search/routes.js b/app/addons/search/routes.js
index f4ba4d3..a578067 100644
--- a/app/addons/search/routes.js
+++ b/app/addons/search/routes.js
@@ -1,28 +1,25 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-import app from '../../app';
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 import FauxtonAPI from '../../core/api';
 import Resources from './resources';
 import SearchActions from './actions';
 import DatabasesActions from '../databases/actions';
 import Databases from '../databases/base';
 import BaseRoute from '../documents/shared-routes';
-import {SidebarItemSelection} from '../documents/sidebar/helpers';
-import CloudantDocuments from '../cloudantdocuments/resources';
-import CloudantDatabases from '../cloudantdatabases/resources';
-import Account from '../account/resources';
 import SidebarActions from '../documents/sidebar/actions';
 import Actions from './actions';
 import Layout from './layout';
 import React from 'react';
+import {SidebarItemSelection} from '../documents/sidebar/helpers';
 
 var SearchRouteObject = BaseRoute.extend({
   routes: {
@@ -57,7 +54,6 @@ var SearchRouteObject = BaseRoute.extend({
   },
 
   initialize: function (route, options) {
-    this.allDatabases = new Databases.List();
     this.databaseName = options[0];
     this.database = new Databases.Model({ id: this.databaseName });
     this.data = {
@@ -200,73 +196,6 @@ var SearchRouteObject = BaseRoute.extend({
   }
 });
 
-
-var SharedSearchRouteObject = SearchRouteObject.extend({
-  routes: {
-    'database/shared/:user/:database/_design/:ddoc/_search/:search(?*searchQuery)': {
-      route: 'sharedSearch',
-      roles: ['fx_loggedIn']
-    },
-    'database/shared/:user/:database/_design/:ddoc/_indexes/:search(?*searchQuery)': {
-      route: 'sharedSearch',
-      roles: ['fx_loggedIn']
-    },
-    'database/shared/:user/:database/new_search': 'sharedNewSearch',
-    'database/shared/:user/:database/new_search/:designDoc': 'sharedNewSearch',
-    'database/shared/:user/:database/_design/:ddoc/_search/:search/edit': {
-      route: 'sharedEdit',
-      roles: ['fx_loggedIn']
-    }
-  },
-
-  initialize: function (route, options) {
-    var docOptions = app.getParams();
-    docOptions.include_docs = true;
-
-    this.username = CloudantDocuments.sharedUsername = options[0];
-    this.databaseName = options[1];
-    this.database = new CloudantDatabases.SharedModel({
-      id: this.databaseName,
-      name: this.username
-    });
-    this.user = new Account.User();
-
-    this.data = {
-      username: this.username,
-      database: this.database
-    };
-
-    this.data.designDocs = new CloudantDocuments.SharedAllDocs(null, {
-      username: this.username,
-      database: this.database,
-      paging: {
-        pageSize: 500
-      },
-      params: {
-        startkey: '"_design"',
-        endkey: '"_design1"',
-        include_docs: true,
-        limit: 500
-      }
-    });
-
-    var initOptions = options.slice(1);
-    SearchRouteObject.prototype.initialize.call(this, route, initOptions);
-  },
-
-  sharedSearch: function (user, database, ddoc, search, query) {
-    return this.searchNoPartition(database, ddoc, search, query);
-  },
-
-  sharedEdit: function (user, database, ddoc, indexName) {
-    return this.editNoPartition(database, ddoc, indexName);
-  },
-
-  sharedNewSearch: function (user, database, ddoc) {
-    return this.createNoPartition(database, ddoc);
-  }
-});
-
-Resources.RouteObjects = [SearchRouteObject, SharedSearchRouteObject];
+Resources.RouteObjects = [SearchRouteObject];
 
 export default Resources;
diff --git a/app/addons/search/tests/nightwatch/cloneSearchIndex.js b/app/addons/search/tests/nightwatch/cloneSearchIndex.js
index 69d6748..a18951c 100644
--- a/app/addons/search/tests/nightwatch/cloneSearchIndex.js
+++ b/app/addons/search/tests/nightwatch/cloneSearchIndex.js
@@ -1,25 +1,3 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
 // use this file except in compliance with the License. You may obtain a copy of
 // the License at
diff --git a/app/addons/search/tests/nightwatch/createNewSearch.js b/app/addons/search/tests/nightwatch/createNewSearch.js
index 6265b67..5710143 100644
--- a/app/addons/search/tests/nightwatch/createNewSearch.js
+++ b/app/addons/search/tests/nightwatch/createNewSearch.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 module.exports = {
 
   'Creates new Search index for Dash': function (client) {
diff --git a/app/addons/search/tests/nightwatch/deleteSearchIndex.js b/app/addons/search/tests/nightwatch/deleteSearchIndex.js
index f4cdc86..0981f22 100644
--- a/app/addons/search/tests/nightwatch/deleteSearchIndex.js
+++ b/app/addons/search/tests/nightwatch/deleteSearchIndex.js
@@ -1,25 +1,3 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
 // use this file except in compliance with the License. You may obtain a copy of
 // the License at
diff --git a/app/addons/search/tests/nightwatch/searchPageApiBar.js b/app/addons/search/tests/nightwatch/searchPageApiBar.js
index ac503c6..6052e55 100644
--- a/app/addons/search/tests/nightwatch/searchPageApiBar.js
+++ b/app/addons/search/tests/nightwatch/searchPageApiBar.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
 module.exports = {
 
   'Check API Bar is present/hidden on appropriate page and is encoded': function (client) {
diff --git a/app/addons/search/tests/nightwatch/sharedSearch.js b/app/addons/search/tests/nightwatch/sharedSearch.js
index 7cae1e2..1f8de00 100644
--- a/app/addons/search/tests/nightwatch/sharedSearch.js
+++ b/app/addons/search/tests/nightwatch/sharedSearch.js
@@ -1,13 +1,14 @@
-/*
-* Licensed Materials - Property of IBM
-*
-* "Restricted Materials of IBM"
-*
-* (C) Copyright IBM Corp. 2018 All Rights Reserved
-*
-* US Government Users Restricted Rights - Use, duplication or disclosure
-* restricted by GSA ADP Schedule Contract with IBM Corp.
-*/
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License./
 module.exports = {
 
   'Edits existing search route works': function (client) {
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index 93c876c..c2564ad 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -712,3 +712,12 @@ body .control-toggle-include-docs span {
   clip: rect(0,0,0,0);
   border: 0;
 }
+
+.btn-group.toggle-btns{
+  input[type=radio] {
+    display: none;
+  }
+  label.btn {
+    margin-right: 0;
+  }
+}
diff --git a/package-lock.json b/package-lock.json
index 85728e6..0151e11 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6437,8 +6437,7 @@
         },
         "ansi-regex": {
           "version": "2.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -6456,13 +6455,11 @@
         },
         "balanced-match": {
           "version": "1.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
-          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -6475,18 +6472,15 @@
         },
         "code-point-at": {
           "version": "1.1.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "concat-map": {
           "version": "0.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "console-control-strings": {
           "version": "1.1.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -6589,8 +6583,7 @@
         },
         "inherits": {
           "version": "2.0.3",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "ini": {
           "version": "1.3.5",
@@ -6600,7 +6593,6 @@
         "is-fullwidth-code-point": {
           "version": "1.0.0",
           "bundled": true,
-          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -6613,20 +6605,17 @@
         "minimatch": {
           "version": "3.0.4",
           "bundled": true,
-          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
         },
         "minimist": {
           "version": "0.0.8",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "minipass": {
           "version": "2.3.5",
           "bundled": true,
-          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
@@ -6643,7 +6632,6 @@
         "mkdirp": {
           "version": "0.5.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -6716,8 +6704,7 @@
         },
         "number-is-nan": {
           "version": "1.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -6727,7 +6714,6 @@
         "once": {
           "version": "1.4.0",
           "bundled": true,
-          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -6803,8 +6789,7 @@
         },
         "safe-buffer": {
           "version": "5.1.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -6834,7 +6819,6 @@
         "string-width": {
           "version": "1.0.2",
           "bundled": true,
-          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
@@ -6852,7 +6836,6 @@
         "strip-ansi": {
           "version": "3.0.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -6891,13 +6874,11 @@
         },
         "wrappy": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "yallist": {
           "version": "3.0.3",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         }
       }
     },
@@ -8400,7 +8381,6 @@
             "align-text": {
               "version": "0.1.4",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "kind-of": "^3.0.2",
                 "longest": "^1.0.1",
@@ -9103,8 +9083,7 @@
             },
             "longest": {
               "version": "1.0.1",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "loose-envify": {
               "version": "1.3.1",
@@ -9880,8 +9859,7 @@
         "safe-buffer": {
           "version": "5.1.1",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
-          "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
-          "optional": true
+          "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
         },
         "semver": {
           "version": "1.0.14",
@@ -12312,8 +12290,7 @@
             "ansi-regex": {
               "version": "2.1.1",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "aproba": {
               "version": "1.2.0",
@@ -12334,14 +12311,12 @@
             "balanced-match": {
               "version": "1.0.0",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "brace-expansion": {
               "version": "1.1.11",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "balanced-match": "^1.0.0",
                 "concat-map": "0.0.1"
@@ -12356,20 +12331,17 @@
             "code-point-at": {
               "version": "1.1.0",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "concat-map": {
               "version": "0.0.1",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "console-control-strings": {
               "version": "1.1.0",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "core-util-is": {
               "version": "1.0.2",
@@ -12486,8 +12458,7 @@
             "inherits": {
               "version": "2.0.3",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "ini": {
               "version": "1.3.5",
@@ -12499,7 +12470,6 @@
               "version": "1.0.0",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "number-is-nan": "^1.0.0"
               }
@@ -12514,7 +12484,6 @@
               "version": "3.0.4",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "brace-expansion": "^1.1.7"
               }
@@ -12522,14 +12491,12 @@
             "minimist": {
               "version": "0.0.8",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "minipass": {
               "version": "2.3.5",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "safe-buffer": "^5.1.2",
                 "yallist": "^3.0.0"
@@ -12548,7 +12515,6 @@
               "version": "0.5.1",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "minimist": "0.0.8"
               }
@@ -12629,8 +12595,7 @@
             "number-is-nan": {
               "version": "1.0.1",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "object-assign": {
               "version": "4.1.1",
@@ -12642,7 +12607,6 @@
               "version": "1.4.0",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "wrappy": "1"
               }
@@ -12728,8 +12692,7 @@
             "safe-buffer": {
               "version": "5.1.2",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "safer-buffer": {
               "version": "2.1.2",
@@ -12765,7 +12728,6 @@
               "version": "1.0.2",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "code-point-at": "^1.0.0",
                 "is-fullwidth-code-point": "^1.0.0",
@@ -12785,7 +12747,6 @@
               "version": "3.0.1",
               "bundled": true,
               "dev": true,
-              "optional": true,
               "requires": {
                 "ansi-regex": "^2.0.0"
               }
@@ -12829,14 +12790,12 @@
             "wrappy": {
               "version": "1.0.2",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             },
             "yallist": {
               "version": "3.0.3",
               "bundled": true,
-              "dev": true,
-              "optional": true
+              "dev": true
             }
           }
         },
@@ -18471,7 +18430,7 @@
     "tmp": {
       "version": "0.0.33",
       "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
-      "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
+      "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=",
       "requires": {
         "os-tmpdir": "~1.0.2"
       }
diff --git a/settings.json.default.json b/settings.json.default.json
index 31935fb..9bd9cf2 100644
--- a/settings.json.default.json
+++ b/settings.json.default.json
@@ -9,6 +9,7 @@
   { "name": "cluster" },
   { "name": "config" },
   { "name": "replication" },
+  { "name": "search" },
   { "name": "cors" },
   { "name": "permissions" },
   { "name": "auth" },
diff --git a/webpack.config.dev.js b/webpack.config.dev.js
index bb8cb07..4eaa0c5 100644
--- a/webpack.config.dev.js
+++ b/webpack.config.dev.js
@@ -117,5 +117,5 @@ module.exports = {
       "underscore": "lodash",
     }
   },
-  devtool: 'source-map'
+  devtool: 'eval-source-map'
 };