Analyzers

Is there a REST API to get the analyzer configuration for a given index? The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh vinh@loggly.com wrote:

Is there a REST API to get the analyzer configuration for a given index? The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

The settings API returns the analyzer configuration:
curl -XPUT 'localhost:9200/myindex' -d '{
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}'

curl -X GET 'localhost:9200/myindex/_settings'
{"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

Regarding your second question, see
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/(end
of the document) - however I am not sure if this works on the top of
my head - need to check.

--Alex

On Wed, Jul 10, 2013 at 11:58 PM, vinh vinh@loggly.com wrote:

Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh vinh@loggly.com wrote:

Is there a REST API to get the analyzer configuration for a given index?
The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

On Thursday, July 11, 2013 3:05:41 AM UTC-4, Alexander Reelsen wrote:

Regarding your second question, see
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/(end of the document) - however I am not sure if this works on the top of
my head - need to check.

It works. I've been using it for the past few days. Like it says, you
have to close the index and reopen it. From then on new documents will be
analysed with the new way. If you want to re-analyse your old documents
you'll have to reindex them all.

--Nik

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

The settings API will not return the analysis settings if they were defined
in templates.

--
Ivan

On Thu, Jul 11, 2013 at 12:05 AM, Alexander Reelsen alr@spinscale.dewrote:

Hey,

The settings API returns the analyzer configuration:
curl -XPUT 'localhost:9200/myindex' -d '{
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}'

curl -X GET 'localhost:9200/myindex/_settings'

{"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

Regarding your second question, see
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/(end of the document) - however I am not sure if this works on the top of
my head - need to check.

--Alex

On Wed, Jul 10, 2013 at 11:58 PM, vinh vinh@loggly.com wrote:

Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh vinh@loggly.com wrote:

Is there a REST API to get the analyzer configuration for a given
index? The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks all. I'm using the Java API to create indexes, and I provide the settings, analysis, and mappings at that time. This is with CreateIndexRequest and calling setSource() with everything, and explicitly calling setMappings() to ensure it takes the mappings.

There's no errors, and the index appears fine. I suspect thought that it's not taking my analysis config because when I call the settings REST api below to see my analyzers, it's not there.

Going to look at the Java code further. Maybe I need to make another API call to set the analyzers. Would like to avoid that though so that I only need to make a single call to create an index with all its configuration.

On Jul 11, 2013, at 12:05 AM, Alexander Reelsen alr@spinscale.de wrote:

Hey,

The settings API returns the analyzer configuration:
curl -XPUT 'localhost:9200/myindex' -d '{
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}'

curl -X GET 'localhost:9200/myindex/_settings'
{"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

Regarding your second question, see http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/ (end of the document) - however I am not sure if this works on the top of my head - need to check.

--Alex

On Wed, Jul 10, 2013 at 11:58 PM, vinh vinh@loggly.com wrote:
Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh vinh@loggly.com wrote:

Is there a REST API to get the analyzer configuration for a given index? The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey Ivan

what do you mean with this? I just tested defining some analyzers in an
index template and it is returned correctly in the mapping after index
creation. Maybe I misunderstood you...

--Alex

On Thu, Jul 11, 2013 at 6:26 PM, Ivan Brusic ivan@brusic.com wrote:

The settings API will not return the analysis settings if they were
defined in templates.

--
Ivan

On Thu, Jul 11, 2013 at 12:05 AM, Alexander Reelsen alr@spinscale.dewrote:

Hey,

The settings API returns the analyzer configuration:
curl -XPUT 'localhost:9200/myindex' -d '{
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}'

curl -X GET 'localhost:9200/myindex/_settings'

{"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

Regarding your second question, see
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/(end of the document) - however I am not sure if this works on the top of
my head - need to check.

--Alex

On Wed, Jul 10, 2013 at 11:58 PM, vinh vinh@loggly.com wrote:

Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh vinh@loggly.com wrote:

Is there a REST API to get the analyzer configuration for a given
index? The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

The analyzer settings definitely do not show up with the Settings API. The
analyzers themselves are defined in elasticsearch.yml and referenced in an
index template.

--
Ivan

On Sun, Jul 14, 2013 at 11:54 PM, Alexander Reelsen alr@spinscale.dewrote:

Hey Ivan

what do you mean with this? I just tested defining some analyzers in an
index template and it is returned correctly in the mapping after index
creation. Maybe I misunderstood you...

--Alex

On Thu, Jul 11, 2013 at 6:26 PM, Ivan Brusic ivan@brusic.com wrote:

The settings API will not return the analysis settings if they were
defined in templates.

--
Ivan

On Thu, Jul 11, 2013 at 12:05 AM, Alexander Reelsen alr@spinscale.dewrote:

Hey,

The settings API returns the analyzer configuration:
curl -XPUT 'localhost:9200/myindex' -d '{
"analysis" : {
"analyzer":{
"content":{
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}'

curl -X GET 'localhost:9200/myindex/_settings'

{"myindex":{"settings":{"index.analysis.analyzer.content.type":"custom","index.analysis.analyzer.content.tokenizer":"whitespace","index.number_of_shards":"5","index.number_of_replicas":"1","index.version.created":"900299"}}}

Regarding your second question, see
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/(end of the document) - however I am not sure if this works on the top of
my head - need to check.

--Alex

On Wed, Jul 10, 2013 at 11:58 PM, vinh vinh@loggly.com wrote:

Also, is there a REST API to set analyzers to an existing index?

On Jul 10, 2013, at 2:47 PM, vinh vinh@loggly.com wrote:

Is there a REST API to get the analyzer configuration for a given
index? The _setting API doesn't appear to return this info.

Thanks,
-Vinh

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.