How can I encrypt the data config portion here?:
A more secure option, I would suggest is to configure a JNDI in your webserver.
How to configure a JNDI? This Page explains how to do so with Tomcat. It can be done for other popular webservers as well.
You can use the JNDI name in your data config file as follows:
< dataSource name="xyz" jndiName="jdbc/xyz" type="JdbcDataSource"/>
See: https://wiki.apache.org/solr/SolrConfigXml#System_property_substitution
You can keep them as properties in the file <solr.home>/conf/solrcore.properties
and refer them in your data config. So your data-config.xml will be like:
<dataSource type="JdbcDataSource"
driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://${jdbc.host}:${jdbc.port}/${db.name}"
user="${jdbc.username}"
password="${jdbc.password}"/>
where everything in ${...}
is a property in solrcore.properties like:
jdbc.host=http://127.0.0.1
jdbc.port=3306
db.name=emp
...