# Can analyzer setting sources loaded from external location using java?

**URL:** <https://discuss.elastic.co/t/can-analyzer-setting-sources-loaded-from-external-location-using-java/6464>\
**Category:** Elasticsearch\
**Created:** [January 23, 2012, 4:55am UTC](https://discuss.elastic.co/t/can-analyzer-setting-sources-loaded-from-external-location-using-java/6464 "2012-01-23T04:55:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [January 23, 2012, 4:55am UTC](https://discuss.elastic.co/t/can-analyzer-setting-sources-loaded-from-external-location-using-java/6464/1 "2012-01-23T04:55:20Z")

</div>

Hi

I'm using following sources setting for analyzer:

{  
"index" : {  
"analysis" : {  
"analyzer" : {  
"customindexanalyzer" : {  
"type":"custom",  
"tokenizer" : "whitespace",  
"filter" : ["lowercase","asciifolding","length","mystopword"],  
"char\_filter" :["html\_strip"]  
},  
"customsearchanalyzer" : {  
"type":"custom",  
"tokenizer" : "whitespace",  
"filter" : ["lowercase","asciifolding","length","mystopword"],  
"char\_filter" :["html\_strip"]  
}  
},  
"filter" : {  
"mystopword": {  
"type" : "stop",  
"stopwords\_path" :"F:/resources/stopwordeng.txt" ,  
"ignore\_case":true  
}  
}  
}  
}  
}

I have read following document : [http://www.elasticsearch.org/guide/reference/setup/configuration.html](http://www.elasticsearch.org/guide/reference/setup/configuration.html)  
I want to put this setting into external json file and load this json  
file when i index the document.can it is possible using java.

Thanks

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [January 23, 2012, 12:16pm UTC](https://discuss.elastic.co/t/can-analyzer-setting-sources-loaded-from-external-location-using-java/6464/2 "2012-01-23T12:16:32Z")

</div>

Use autocompletion of your IDE 😉 and choose one of:

client.admin().cluster().prepareUpdateSettings().setPersistentSettings(map);  
client.admin().cluster().prepareUpdateSettings().setTransientSettings(map)  
// or for index related settings  
client.admin().indices().preparePutMapping("your\_index\_name").setSource(map);

Peter.

On 23 Jan., 05:55, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:

> Hi
> 
> I'm using following sources setting for analyzer:
> 
> {  
> "index" : {  
> "analysis" : {  
> "analyzer" : {  
> "customindexanalyzer" : {  
> "type":"custom",  
> "tokenizer" : "whitespace",  
> "filter" : ["lowercase","asciifolding","length","mystopword"],  
> "char\_filter" :["html\_strip"]  
> },  
> "customsearchanalyzer" : {  
> "type":"custom",  
> "tokenizer" : "whitespace",  
> "filter" : ["lowercase","asciifolding","length","mystopword"],  
> "char\_filter" :["html\_strip"]}  
> },
> 
> "filter" : {  
> "mystopword": {  
> "type" : "stop",  
> "stopwords\_path" :"F:/resources/stopwordeng.txt" ,  
> "ignore\_case":true
> 
> }  
> }  
> }  
> }  
> }
> 
> I have read following document :[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/configuration.html)  
> I want to put this setting into external json file and load this json  
> file when i index the document.can it is possible using java.
> 
> Thanks

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 23, 2012, 7:03pm UTC](https://discuss.elastic.co/t/can-analyzer-setting-sources-loaded-from-external-location-using-java/6464/3 "2012-01-23T19:03:34Z")

</div>

You can use the create index API.

String indexSettings = // load the json from wherever you want  
client.admin().indices().prepareCreate("index\_name").setSettings(indexSettings).execute().actionGet();

On Mon, Jan 23, 2012 at 6:55 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> I'm using following sources setting for analyzer:
> 
> {  
> "index" : {  
> "analysis" : {  
> "analyzer" : {  
> "customindexanalyzer" : {  
> "type":"custom",  
> "tokenizer" : "whitespace",  
> "filter" : ["lowercase","asciifolding","length","mystopword"],  
> "char\_filter" :["html\_strip"]  
> },  
> "customsearchanalyzer" : {  
> "type":"custom",  
> "tokenizer" : "whitespace",  
> "filter" : ["lowercase","asciifolding","length","mystopword"],  
> "char\_filter" :["html\_strip"]  
> }  
> },  
> "filter" : {  
> "mystopword": {  
> "type" : "stop",  
> "stopwords\_path" :"F:/resources/stopwordeng.txt" ,  
> "ignore\_case":true  
> }  
> }  
> }  
> }  
> }
> 
> I have read following document :  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/configuration.html)  
> I want to put this setting into external json file and load this json  
> file when i index the document.can it is possible using java.
> 
> Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:41am UTC](https://discuss.elastic.co/t/can-analyzer-setting-sources-loaded-from-external-location-using-java/6464/4 "2017-07-06T03:41:49Z")

</div>


