Just FYI, the dynamic mapping applies only to fields that you have no explicit mappings defined. In your case, you predefined field1 and field2 as type string so the dynamic mapping will ignore those 2 fields and will not be applied to them. That is probably the cause of your query behaviors.
If you remove field1 and field2 from your initial mapping, I think you should get what you are expecting. -- 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/afdbdac5-7315-42ef-a2b9-c30a488408ec%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
