- add solr configuratiom

Arno Kaimbacher 2020-07-20 14:45:08 +02:00
parent 9166d5d920
commit d752b43c18

@ -29,5 +29,80 @@ Customize Solr startup configuration in /etc/default/solr.in.sh
check if solr service is running:\
`sudo service solr status`\
or via browser:\
or via Solr Admin Panel:\
<http://localhost:8983/solr/#/>
## Configuration SOLR
```bash
sudo mkdir -p /var/solr/data/tethys_data/conf
sudo mkdir -p /var/solr/data/tethys_data/data
```
**Configure Stopwords for your solr index**\
Solr has the ability to read in a list of stop words, or words that should be ignored during indexing, so that those words do not clutter your index and are removed from influencing result relevancy. Add a list of common stop words to your stopwords.txt file.\
`sudo nano /var/solr/data/tethys_data/conf/stopwords.txt`\
So your file might look something like this:
```ini
#Stopwords for example.com
a
an
and
are
as
at
be
but
by
for
if
...
```
**Configure Synonyms for your solr index**\
`sudo nano /var/solr/data/tethys_data/conf/synonyms.txt`
```ini
# Synonym mappings can be used for spelling correction too
pixima => pixma
```
**Copy your model schema and solr configuration into conf folder:**
```bash
sudo cp /home/user/managed-schema /var/solr/data/tethys_data/conf/
sudo cp /home/user/solrconfig.xml /var/solr/data/tethys_data/conf/
```
**Grant folder permissions for solr user**\
`sudo chown -R solr:solr /var/solr/data/tethys_data/`
**Create solr index (c = Collection name; d = folder name)**\
`sudo su - solr -c "/opt/solr/bin/solr create -c tethys_data -d /var/solr/data/tethys_data/ -n /var/solr/data/tethys_data/conf/"`
Output Will be:\
Created new core 'tethys_data'
## Manage Solr service
```bash
sudo service solr status
sudo service solr start
sudo service solr stop
```
## Uninstall SOLR
```bash
sudo service solr stop
sudo rm -r /var/solr
sudo rm -r /opt/solr-7.7.3
sudo rm -r /opt/solr
sudo rm -r /opt/solr-7.7.3.tgz
sudo rm /opt/install_solr_service.sh
sudo rm /etc/init.d/solr
sudo rm /etc/default/solr.in.sh
sudo deluser --remove-home solr
sudo deluser --group solr
```