- }
-
-
- /**
- * Returns the set of pre-configured filters.
- *
- * @return - An array of filters.
- */
- public FilterSchema[] getFilters() {
- return customFilters;
- }
-
-
- /**
- * Returns the set of pre-configured analyzers.
- *
- * @return - An array of analyzers.
- */
- public AnalyzerSchema[] getAnalyzers() {
- init(SearchDbConstants.SDB_FILTER_CONFIG_FILE, SearchDbConstants.SDB_ANALYSIS_CONFIG_FILE);
- return customAnalysers;
- }
-
-
- /**
- * Imports the filter and analyzer configurations and translates those
- * into a settings string that will be parseable by Elastic Search.
- *
- * @return - Elastic Search formatted settings string.
- */
- public String getEsIndexSettings() {
-
- // Generate the es-settings string from our filter and analyzer
- // configurations if we have not already done so.
- init(SearchDbConstants.SDB_FILTER_CONFIG_FILE, SearchDbConstants.SDB_ANALYSIS_CONFIG_FILE);
-
- // Now, return the es-settings string.
- return esSettings;
- }
-
-
- /**
- * Constructs a settings string that is readable by Elastic Search based
- * on the contents of the filter and analyzer configuration files.
- *
- * @return Elastic Search formatted settings string.
- */
- public String buildEsIndexSettings() {
-
- StringBuilder sb = new StringBuilder();
-
- sb.append("{");
- sb.append("\"analysis\": {");
-
- // Define the custom filters.
- boolean atLeastOneFilter = false;
- sb.append("\"filter\": {");
- AtomicBoolean firstFilter = new AtomicBoolean(true);
- for (FilterSchema filter : customFilters) {
-
- // Append a comma before the next entry, unless it is the
- // first one.
- if (!firstFilter.compareAndSet(true, false)) {
- sb.append(", ");
- }
-
- // Now, build the filter entry.
- buildFilterEntry(filter, sb);
- atLeastOneFilter = true;
+
+
+ /**
+ * Returns the set of pre-configured filters.
+ *
+ * @return - An array of filters.
+ */
+ public FilterSchema[] getFilters() {
+ return customFilters;
+ }
+
+
+ /**
+ * Returns the set of pre-configured analyzers.
+ *
+ * @return - An array of analyzers.
+ */
+ public AnalyzerSchema[] getAnalyzers() {
+ init(SearchDbConstants.SDB_FILTER_CONFIG_FILE, SearchDbConstants.SDB_ANALYSIS_CONFIG_FILE);
+ return customAnalysers;