Skip to content

Instantly share code, notes, and snippets.

@nik9000
Created April 25, 2014 16:17
Show Gist options
  • Save nik9000/11294985 to your computer and use it in GitHub Desktop.
Save nik9000/11294985 to your computer and use it in GitHub Desktop.
diff --git a/src/main/java/org/elasticsearch/index/analysis/DefaultAsCustom.java b/src/main/java/org/elasticsearch/index/analysis/DefaultAsCustom.java
new file mode 100644
index 0000000..f3bf301
+public interface DefaultAsCustom<T extends AnalyzerProvider> {
+ void build(XContentBuilder builder) throws IOException;
+}
diff --git a/src/main/java/org/elasticsearch/index/analysis/StandardAnalyzerProvider.java b/src/main/java/org/elasticsearch/index/analysis/StandardAnalyzerProvider.java
@@ -60,4 +63,11 @@ public class StandardAnalyzerProvider extends AbstractIndexAnalyzerProvider<Stan
public StandardAnalyzer get() {
return this.standardAnalyzer;
}
+
+ public static class StandardDefaultAsCustom implements DefaultAsCustom<StandardAnalyzerProvider> {
+ @Override
+ public void build(XContentBuilder builder) throws IOException {
+ AnalyzerXContentUtil.buildAnalyzer(builder, "standard", "standard", "standard", "lowercase");
+ }
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment