Hello Piyush,

You could set the default mapping for all strings to be not_analyzed by
using dynamic templates:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates

Alternatively, you can set the default analyzer to "keyword":
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-analyzers.html#default-analyzers

Best regards,
Radu

--
Performance Monitoring * Log Analytics * Search Analytics
Solr & Elasticsearch Support * http://sematext.com/


On Tue, Apr 29, 2014 at 5:06 PM, Piyush Rai <[email protected]> wrote:

> I am facing a problem with elasticsearch where I dont want my indexed term
> to be analyzed. But the elasticsearch has some default setting which is
> tokenizing it on space. Therefore my facet query is not returning the
> result I want.
>
> I read that "index" : "not_analyzed" in properties of index type should
> work. But the problem is that I dont know my document structure before
> hand. I would be indexing random MySQL databases to elasticsearch without
> knowing the table structure.
>
> How can I setup elasticsearch such that by default it uses "index" :
> "not_analyzed" until otherwise asked for. Thanks
>
> PS: I am using java if I can directly use any API for it I would love it.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/5a6d9c36-ab27-491f-a7f5-9fc90f3fe802%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAHXA0_2pVZ5QYVT_XqYprCJHa0tCVUGydDW03D4p9nowNHwJRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to