Substring search for all the fields

So I've been struggling with partial matches, and I found this very nice
link:

http://mnylen.tumblr.com/post/22963609412/elasticsearch-and-a-simple-contains-search

which does exactly what I want, but only one problem, I want that behaviour
by default for every field..
I can't find a way to get it done though, there must be a way to not be
forced to do it for every field right?
I tried something like this for example but it also doesn't work

        mapping = {
            index: {
                "properties": {
                    "default": {
                    "type": "string",
                    "search_analyzer": "str_search_analyzer",
                    "index_analyzer": "str_index_analyzer",
                    }
                }
            }
        }

Any hint?

--
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 could set the str_search_analyzer and str_index_analyzer as default:

"analyzer": {
"default_index": {
"tokenizer": "keyword",
"filter": ["lowercase", "asciifolding"]
},
"default_search": {
"tokenizer": "keyword",
"filter": ["lowercase", "asciifolding"]
}
}

Or you could create a dynamic mapping for all fields, e.g

"dynamic_templates": [
{
{
"template_all_field": {
"match": "*",
"mapping": {
"type": "string",
"search_analyzer": "str_search_analyzer",
"index_analyzer": "str_index_analyzer",

                }
            }
        }
    ]

--
Runar Myklebust
Enonic AS

On Tue, Mar 5, 2013 at 12:27 PM, andrea crotti andrea.crotti.0@gmail.comwrote:

So I've been struggling with partial matches, and I found this very nice
link:

http://mnylen.tumblr.com/post/22963609412/elasticsearch-and-a-simple-contains-search

which does exactly what I want, but only one problem, I want that
behaviour by default for every field..
I can't find a way to get it done though, there must be a way to not be
forced to do it for every field right?
I tried something like this for example but it also doesn't work

        mapping = {
            index: {
                "properties": {
                    "default": {
                    "type": "string",
                    "search_analyzer": "str_search_analyzer",
                    "index_analyzer": "str_index_analyzer",
                    }
                }
            }
        }

Any hint?

--
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.