Indexing LatLonType and PointType field types stores data in internal fields that should not be returned in search results. For these fields a dynamic field type matching the suffix needs to be added to store the data points. Solr 6+ comes with a new LatLonPointSpatialField field type that should be used instead of LatLonType if possible. Otherwise, a LatLongType field should be defined as:
<dynamicField name="*.location_point" type="location" multiValued="false" docValues="false"/> <dynamicField name="*_coordinate" type="pdouble" indexed="true" stored="false" docValues="false"/> <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
A PointType field should be defined as:
<dynamicField name="*.point" type="point" multiValued="false" docValues="false"/> <dynamicField name="*_point" type="pdouble" indexed="true" stored="false" docValues="false"/> <fieldType name="point" class="solr.PointType" subFieldSuffix="_point"/>
If any copy fields are defined, stored and docValues should be set to false.
Convenience scripts are provided with Metron to create and delete collections. Ambari uses these scripts to automatically create collections. To use them outside of Ambari, a few environment variables must be set first:
# Path to the zookeeper node used by Solr export ZOOKEEPER=node1:2181/solr # Set to true if Kerberos is enabled export SECURITY_ENABLED=true
The scripts can then be called directly with the collection name as the first argument . For example, to create the bro collection:
$METRON_HOME/bin/create_collection.sh bro
To delete the bro collection:
$METRON_HOME/bin/delete_collection.sh bro
The create_collection.sh
script depends on schemas installed in $METRON_HOME/config/schema
. There are several schemas that come with Metron:
Additional schemas should be installed in that location if using the create_collection.sh
script. Any collection can be deleted with the delete_collection.sh
script. These scripts use the Solr Collection API.