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:

  1.   cat  /etc/default/solr.in.sh | grep SOLR_HOME

#SOLR_HOME=/opt/solr-7.7.0/server/solr
SOLR_HOME="/var/solr/data"

  1. e.g., new name of collection is "drupal_core" with a directory "drupal_core"
  2. mkdir /var/solr/data/drupal_core
  3. chown -R solr:solr /var/solr/data/drupal_core
  4. cd /var/solr/data/drupal_core
  5. locate solrconfig.xml
    ...
    /opt/solr-7.7.0/server/solr/configsets/_default/conf/solrconfig.xml
    ...
  6. 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 ./

  7. 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
     
  8. chown -R solr:solr conf
  9. chmod -R 755 conf
  10. service solr restart

Configuration is executed!


additional DEEP configuration

Making a partial matching
  1. cd conf
  2. 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:

  1. Sign in to your Drupal website as an administrative user.
  2. In the admin menu, go to Structure > Views.
  3. Find the view that you want to configure, and then click its Edit link.
  4. Edit the Search: fulltext search filter.
  5. For each filter criterion for which you want to use partial-word searching, click the Parse mode check box, and then click Direct query.
  6. 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.