NetX relies on Apache Solr to provide robust search capability. Starting in version 10, NetX requires the use of Solr 8. This guide provides instructions on the steps necessary to install the new version of Solr and remove the legacy Solr files from an existing NetX installation.
Installing Solr 8
- This tutorial assumes that you have already downloaded and run the NetX 9+ installer to upgrade your existing NetX application files. If you have not done so, follow the steps in the Upgrading NetX section in Upgrading NetX on Windows first, then return to this tutorial.
- Download the Solr installation package here: https://www.apache.org/dyn/closer.lua/lucene/solr/8.11.1/solr-8.11.1.zip?action=download
- Create a Solr folder. In this example, we will create C:\Program Files\Solr.
- Extract or copy the contents of the zip file into C:\Program Files\Solr.
- You now need to copy the Solr core from the NetXposure application folder into the Solr folder. Copy the C:\Program Files\NetXposure\solr-cores\8\netx folder into C:\Program Files\Solr\server\solr\. When you are finished, you should have a C:\Program Files\Solr\server\solr\netx folder that contains the Solr cores.
- Copy your existing synonyms.txt file from C:\Program Files\NetXposure\solr\netx\conf into C:\Program Files\Solr\server\solr\netx\conf and overwrite the default file if requested. If you have a synonyms-custom.txt file inside of your NetX application directory, that file should be copied instead of synonyms.txt and renamed to synonyms.txt once it has been copied into the Solr application folder. Synonyms-custom.txt is no longer a supported filename.
-
Now it's time to start Solr. Open Powershell, and run this command: 'C:\Program Files\Solr\bin\solr.cmd' start
-
Now that Solr has successfully started, You should be able to log into the Solr admin console using the port number shown when you start the engine. Open a web browser and type http://localhost:8983/solr/
- Click Core Admin to make sure Solr is able to load the NetX core.
-
To inform the NetX application where to find the new Solr installation, edit the exogen-config.xml file and correct the value for the property below:
Property Description searchEngine.solrUrl This value tells NetX where to locate the NetX service.
Value options: http://127.0.0.1:8983/solr/netx
Requires restart? Yes
Solr memory settings
By default, the bin/solr script sets the maximum Java heap size to 512M (-Xmx512m). For production, you’ll want to increase the maximum heap size; we recommend starting with at least 2 GB. To do this, open the C:\Program Files\Solr\bin\solr.in.cmd file and edit the SOLR_JAVA_MEM variable as such:
SOLR_JAVA_MEM="-Xms512m -Xmx2048m"
Remember to restart Solr after changing the memory settings. Open Powershell and run these commands:
& 'C:\Program Files\Solr\bin\solr.cmd' stop -all
& 'C:\Program Files\Solr\bin\solr.cmd' start
Removing old Solr files
Now that you have a separate instance of Solr, you can safely remove the old Solr application files that were bundled with the NetX installation.
- Remove the Solr WAR file. By default, this is located in C:\Program Files\NetXposure\webapps\solr.war.
- If there is an unpacked WAR, remove C:\Program Files\NetXposure\webapps\solr as well.
- Remove the configuration descriptor: C:\Program Files\NetXposure\conf\Catalina\localhost\solr.xml
- Back up the old index data, found here: C:\Program Files\NetXposure\solr\netx\data. After the data has been backed up, you can delete the C:\Program Files\NetXposure\solr directory.
Starting NetX
Now that Solr 7 has been installed and started, you can start the NetX service.
- Open the Services console on your Windows server.
- Find the NetX service, right-click and hit Start.
- Wait for the status to report that the service has been started.>
Verifying the upgrade
After initial startup after the upgrade to NetX 10, log in to the site and verify that assets and data appear correctly and that search is functioning properly. If you encounter issues, you may need to launch a manual reindex of your site. This could take a while to complete depending on the size of your installation (number of assets and/or attributes) so you may experience missing assets or other data inconsistencies until the reindex is complete.
Running Solr as a Windows service
Since Solr is no longer managed by the NetX service, it will have to be manually started if the server reboots or is shut down. It is possible to run Solr as a Windows service using third-party solutions, but NetX cannot guarantee support for those configurations. Do so at your own risk.