Solr + Drupal
After enabling the Solr-module: https://www.drupal.org/project/search_api_solr
There is a time to make some configuration:
When you have decided, which name of collection this Solr index will use, further steps must be done:
- cat /etc/default/solr.in.sh | grep SOLR_HOME
#SOLR_HOME=/opt/solr-7.7.0/server/solr
SOLR_HOME="/var/solr/data"
- e.g., new name of collection is "drupal_core" with a directory "drupal_core"
- mkdir /var/solr/data/drupal_core
- chown -R solr:solr /var/solr/data/drupal_core
- cd /var/solr/data/drupal_core
- locate solrconfig.xml
...
/opt/solr-7.7.0/server/solr/configsets/_default/conf/solrconfig.xml
... cp -R /opt/solr-7.7.0/server/solr/configsets/_default/conf/* ./
cp -R /opt/solr-7.7.3/server/solr/configsets/_default/conf/* ./
chown -R solr:solr ./cp -R /var/www/html/profiles/standard/modules/search_api_solr/solr-conf/7.x conf
cp -R /var/www/websites/client1/domain2/web/sites/all/modules/apachesolr/solr-conf/solr-7.x conf
D9 diff. - copy config.zip from website
1) wget http://web.site/admin/config/search/search-api/server/solr_search_server...
2) unzip solr_7.x_config.zip -d conf
- chown -R solr:solr conf
- chmod -R 755 conf
- service solr restart
Configuration is executed!
additional DEEP configuration
Making a partial matching
- cd conf
- nano schema.xml
already substituted file schema.xml:
Alt+M
{set position by clicking on left mouse pad}
Ctrl+V {till the very bottom}
Ctrl+K
Alt+M
{paste desired text by clicking on right pad}
schema.xml | <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/> <filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="25" /> |
remove everywhere from schema.xml - solr.WordDelimiterFilterFactory
<filter class="solr.WordDelimiterFilterFactory" .../>
service solr restart
Configuring your views for partial-word searching
To configure the filters in your views to accept partial-word search queries to your Solr backend, perform the following steps:
- Sign in to your Drupal website as an administrative user.
- In the admin menu, go to Structure > Views.
- Find the view that you want to configure, and then click its Edit link.
- Edit the Search: fulltext search filter.
- For each filter criterion for which you want to use partial-word searching, click the Parse mode check box, and then click Direct query.
- Click Save.
Direct query
Direct query - actually, another command, - like
The query is interpreted as multiple keywords separated by spaces. Keywords containing spaces may be "quoted". Quoted keywords must still be separated by spaces.
has to operate also.