I have introduced a default-mapping.json to store all fields of type
string in a normal and a reversed version. That works great so far!
My problem is that now I cannot search for date fields anymore. It
seems that the dynamic
template applies to date fields as well, although I've
set "match_mapping_type" to "string".
Elasticsearch says: Field [...] is not a numeric type.
A possible solution would be to use field prefixes and configure
the dynamic template to only apply to fields that match "string_*".
e.g. document.string_name, document.string_email, document.date_lastlogin,
...
I have introduced a default-mapping.json to store all fields of type
string in a normal and a reversed version. That works great so far!
My problem is that now I cannot search for date fields anymore. It
seems that the dynamic
template applies to date fields as well, although I've
set "match_mapping_type" to "string".
Elasticsearch says: Field [...] is not a numeric type.
A possible solution would be to use field prefixes and configure
the dynamic template to only apply to fields that match "string_*".
e.g. document.string_name, document.string_email, document.date_lastlogin,
...
I just tested with the latest repository version 0.19.0 SNAPSHOT which
includes commit:
*Mapping: Improve applying guessed types on dynamic templates, closes #1446.
*
But the problem still exists.
If I don't use this dynamic_template I am able to search for strings and
dates.
If I use the given dynamic mapping above, then i can only search for
strings but for dates it says: Field [...] is not a numeric type.
If you need more information about this or maybe some logs, please let me
know.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.