rzezeski/yokozuna — pull request #16 by dreverri (2012-10-28 18:22:30+00:00)
Title: JSON extractor that adds suffixes to fields based on value type

The extractor behaves very much like the existing JSON extractor. Arrays create multi-value fields and nested object field names are concatenated by a field separator (`_` by default). The only difference is the field names are suffixed according to the value type. The suffixes added to fields by this extractor correspond to the dynamic field definitions in the default schema.

* String - `*_t`
* Number - `*_d`
* Boolean - `*_b`
* Multi value
* String - `*_txt`
* Number - `*_ds`
* Boolean - `*_bs`

Also, the function `yz_solr:prepare_xml/1` has been added to allow tests to generate XML data from extracted fields. While indexing documents I found that boolean and number values were not generated correctly. All values should be converted to binary in the extractor or the XML data will be incorrect. The included test extracts fields from sample JSON data and generates XML data.