Kevin.
Do you mean the index settings query API? For example, I issued the
following query against my sgen (schema generation, an experimental index
for exploring Elasticsearch mapping nooks and crannies):
$ curl -XGET 'http://localhost:9200/sgen/_settings?pretty=true' && echo
And it gives me the following, which makes it easy (at least by looking at
the JSON and my experience with parsing JSON) to deterministically list all
of the custom analyzers that are defined:
{
"sgen" : {
"settings" : {
"index" : {
"uuid" : "ecznJNykSl-DguwyN6SIZg",
"number_of_replicas" : "0",
"analysis" : {
"char_filter" : {
"finnish_char_mapper" : {
"type" : "mapping",
"mappings" : [ "Å=>O", "å=>o", "W=>V", "w=>v" ]
}
},
"analyzer" : {
"english_standard_analyzer" : {
"type" : "custom",
"filter" : [ "standard", "lowercase", "asciifolding" ],
"tokenizer" : "standard"
},
"finnish_stemming_analyzer" : {
"type" : "custom",
"char_filter" : [ "finnish_char_mapper" ],
"filter" : [ "standard", "lowercase",
"finnish_snowball_filter" ],
"tokenizer" : "standard"
},
"english_stemming_analyzer" : {
"type" : "custom",
"filter" : [ "standard", "lowercase", "asciifolding",
"english_snowball_filter" ],
"tokenizer" : "standard"
},
"english_stemming_stop_analyzer" : {
"type" : "custom",
"filter" : [ "standard", "lowercase", "asciifolding",
"english_stop_filter", "english_snowball_filter" ],
"tokenizer" : "standard"
},
"russian_stemming_analyzer" : {
"type" : "custom",
"filter" : [ "standard", "lowercase",
"russian_snowball_filter" ],
"tokenizer" : "standard"
},
"arabic_stemming_Arabic_analyzer" : {
"type" : "custom",
"filter" : [ "standard", "lowercase",
"Arabic_stemming_filter" ],
"tokenizer" : "standard"
}
},
"filter" : {
"finnish_snowball_filter" : {
"type" : "snowball",
"language" : "Finnish"
},
"english_stop_filter" : {
"type" : "stop",
"language" : [ "english" ]
},
"english_snowball_filter" : {
"type" : "snowball",
"language" : "English"
},
"russian_snowball_filter" : {
"type" : "snowball",
"language" : "Russian"
},
"Arabic_stemming_filter" : {
"type" : "stemmer",
"name" : "Arabic"
}
}
},
"number_of_shards" : "1",
"refresh_interval" : "2s",
"version" : {
"created" : "1000099"
}
}
}
}
}
Since in my case I never use a built-in analyzer, I don't need to query the
field mappings to find them, nor do I need to depend on ES to dynamically
detect the "correct" mapping (I turn all that stuff off). So the bottom
line is: Disabling auto-index creation and auto-type mapping of new fields
makes the system more robust, and has the wonderful side effect of making
discovery of the schema easy and deterministic!
But for the available built-in analyzers, the Java side might be possible
by listing the analyzer classes in the org.elasticsearch.index.analysispackage. It would involve a bit of Java reflection to automate this, but
perhaps it could be done.
Hope this helps!
Brian
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8f28a827-9627-4e6d-95af-d3ee78ca83c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.