用Solrj 存储一个point类型的字段,其字段类型的class为 solr.PointType。
这是managed-schema文件中相应的一段:
<!-- This point type indexes the coordinates as separate fields (subFields)
If subFieldType is defined, it references a type, and a dynamic field
definition is created matching *___<typename>. Alternately, if
subFieldSuffix is defined, that is used to create the subFields.
Example: if subFieldType="double", then the coordinates would be
indexed in fields myloc_0___double,myloc_1___double.
Example: if subFieldSuffix="_d" then the coordinates would be indexed
in fields myloc_0_d,myloc_1_d
The subFields are an implementation detail of the fieldType, and end
users normally should not need to know about them.
-->
<fieldType name="complex" class="solr.PointType" dimension="2" subFieldSuffix="_d" />
请注意上面的注释:
If subFieldType is defined, it references a type, and a dynamic field definition is created matching *___<typename>.
它指明了动态字段的构造格式。
通过SolrJ或SolrClient向此字段中写入数据的格式如下:
doc.setField("xy___complex", "22.103,59.202");