# Analyze API + char\_filter

**URL:** <https://discuss.elastic.co/t/analyze-api-char-filter/10820>\
**Category:** Elasticsearch\
**Created:** [February 20, 2013, 2:54pm UTC](https://discuss.elastic.co/t/analyze-api-char-filter/10820 "2013-02-20T14:54:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaynier](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jmaynier](https://discuss.elastic.co/u/jmaynier)\
**Post date:** [February 20, 2013, 2:54pm UTC](https://discuss.elastic.co/t/analyze-api-char-filter/10820/1 "2013-02-20T14:54:58Z")

</div>

Hi,

Does the analyze API (  
[http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html))  
support the char\_filter ?  
I tried

curl -XGET  
'localhost:9200/\_analyze?tokenizer=keyword&filters=lowercase&char\_filter=myCharFilter'  
-d 'this is a test'  
and  
curl -XGET  
'localhost:9200/\_analyze?tokenizer=keyword&filters=lowercase&char\_filters=myCharFilter'  
-d 'this is a test'

without success.  
Any idea ?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 20, 2013, 8:10pm UTC](https://discuss.elastic.co/t/analyze-api-char-filter/10820/2 "2013-02-20T20:10:23Z")

</div>

I have never tried a custom filter, but with analyzers, they will only work  
if you are analyze against an index that is using them. The analyzer would  
need to be loaded/instantiated first before it can be used, and that only  
occurs when an index that uses the analyzer (in the mapping) is created. I  
would assume filters have the same limitation.

Cheers,

Ivan

On Wed, Feb 20, 2013 at 6:54 AM, Jecom [jmaynier@eco2market.com](mailto:jmaynier@eco2market.com) wrote:

> Hi,
> 
> Does the analyze API (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html))  
> support the char\_filter ?  
> I tried
> 
> curl -XGET  
> 'localhost:9200/\_analyze?tokenizer=keyword&filters=lowercase&char\_filter=myCharFilter'  
> -d 'this is a test'  
> and  
> curl -XGET  
> 'localhost:9200/\_analyze?tokenizer=keyword&filters=lowercase&char\_filters=myCharFilter'  
> -d 'this is a test'
> 
> without success.  
> Any idea ?
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![egaumer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/egaumer/32/2365_2.png) [@egaumer](https://discuss.elastic.co/u/egaumer)\
**Post date:** [February 20, 2013, 8:22pm UTC](https://discuss.elastic.co/t/analyze-api-char-filter/10820/3 "2013-02-20T20:22:55Z")

</div>

Looks like the \_analyze endpoint only supports token filters. I don't see a  
way to pass in char filters.

[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/analyze/RestAnalyzeAction.java#L74](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/analyze/RestAnalyzeAction.java#L74)

-Eric

On Wednesday, February 20, 2013 9:54:58 AM UTC-5, Jecom wrote:

> Hi,
> 
> Does the analyze API (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html))  
> support the char\_filter ?  
> I tried
> 
> curl -XGET  
> 'localhost:9200/\_analyze?tokenizer=keyword&filters=lowercase&char\_filter=myCharFilter'  
> -d 'this is a test'  
> and  
> curl -XGET  
> 'localhost:9200/\_analyze?tokenizer=keyword&filters=lowercase&char\_filters=myCharFilter'  
> -d 'this is a test'
> 
> without success.  
> Any idea ?

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 20, 2013, 9:00pm UTC](https://discuss.elastic.co/t/analyze-api-char-filter/10820/4 "2013-02-20T21:00:06Z")

</div>

Ha, didn't think that would be the limitation! Shouldn't be too hard to add  
in. The eventual consumer, TransportAnalyzeAction, is just using an empty  
char filter array.

[https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java#L185](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java#L185)

On Wed, Feb 20, 2013 at 12:22 PM, egaumer [egaumer@gmail.com](mailto:egaumer@gmail.com) wrote:

> Looks like the \_analyze endpoint only supports token filters. I don't see  
> a way to pass in char filters.
> 
> [https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/analyze/RestAnalyzeAction.java#L74](https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/rest/action/admin/indices/analyze/RestAnalyzeAction.java#L74)
> 
> -Eric
> 
> On Wednesday, February 20, 2013 9:54:58 AM UTC-5, Jecom wrote:
> 
> > Hi,
> > 
> > Does the analyze API ([http://www.elasticsearch.org/](http://www.elasticsearch.org/)\*\*  
> > guide/reference/api/admin-\*\*indices-analyze.html[http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html))  
> > support the char\_filter ?  
> > I tried
> > 
> > curl -XGET 'localhost:9200/\_analyze? **tokenizer=keyword&filters=**  
> > lowercase&char\_filter=\*\*myCharFilter' -d 'this is a test'  
> > and  
> > curl -XGET 'localhost:9200/\_analyze? **tokenizer=keyword&filters=**  
> > lowercase&char\_filters=\*\*myCharFilter' -d 'this is a test'
> > 
> > without success.  
> > Any idea ?
> 
> --  
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:50am UTC](https://discuss.elastic.co/t/analyze-api-char-filter/10820/5 "2017-07-06T02:50:26Z")

</div>


