Make an analyzed field to a not_analyzed

Hi there,

I have some a field "domain" and a filtered alias on that field.
The problem is i have the field "domain" with default settings, which means "analyzed".
I have "domain" values like "test.com" and "test-book.com" .

My alias search with with /test.com/_search works fine, but all values with a hyphen do not work.
I set the "domain" field "not_analyzed" and it worked with that.

Can i now set all the indexed documents with the "not_analyzed" mapping, cause i think it will only work for the new inserted documents. How can i fix that and make all the inserted fields from analyzed to not_analyzed?

regards
Andi

When you change a mapping for an existing field, you have to reindex your data.

This blog post outlines how to do this with zero downtime.