Debugging Search Issues with Crafter Search
Overview of Search Mechanics
Flow
Indexing Process:
Author updates content in Crafter Studio.
Studio notifies the Deployer of the changes in a particular target (which is the combination of site/environment). Then:
On preview update, the Deployer inspects the
sandbox
and resolves the changes by doing a file diff between the last Git commit it processed and the latest commit in thesandbox
.On publish, Studio moves the changes to
published
and the Deployer in delivery pulls the changes.
A processor of the target in the Deployer sends a request to the search engine with the XML or content to index.
Crafter Search then generates a Solr document based on the received XML/content and sends it to Solr for indexing.
Querying Process:
The end user makes a page or service request to Crafter Engine.
Crafter Engine components requiring queries issue a query to Crafter Search.
Crafter Search applies simple rules/additions to the query and issues the query to Solr.
Note
Crafter Search and Solr is supported for backward compatibility. CrafterCMS’s default search engine is Elasticsearch.
To update your sites to Elasticsearch, follow the guide Migrating a site from Solr to Elasticsearch
Places Search Indexing Can Get Hung Up
Communication Between Crafter Studio & Crafter Deployer
Crafter Studio will notify the Deployer when content has changed.
Ensure that the Deployer is pulling the changes.
If the Deployer is not receiving any changes, check network connectivity and ports.
Communication Between Crafter Deployer & Crafter Search
The Deployer has a target with a Search Processor.
Ensure that the processor is configured to the proper HOST, PORT for Crafter Search.
Ensure that the processor is not failing before sending the changes to Solr.
Communication Between Crafter Search & Solr
Crafter Search is configured to talk to a Solr index.
Ensure that Crafter Search is configured to the proper HOST, PORT for Solr.
Ensure that the Solr index is configured properly.
Communication Between Crafter Engine & Crafter Search
Crafter Engine is configured to talk to Crafter Search.
Ensure that Crafter Engine is configured to the proper HOST, PORT for Crafter Search.
Reviewing Log Files
In order to figure out which of the possible failures described in the previous section happened, you should review the following log files for each one of the components:
Component
|
Log Files
|
---|---|
Crafter Studio
|
CRAFTER/logs/tomcat/catalina.out |
Crafter Deployer
|
CRAFTER/logs/deployer/deployer.out CRAFTER/logs/deployer/deployer-general.log CRAFTER/logs/deployer/{target}-{env}.log |
Crafter Search
|
CRAFTER/logs/tomcat/catalina.out |
Solr
|
CRAFTER/logs/solr/solr.log |
Crafter Engine
|
CRAFTER/logs/tomcat/catalina.out |
Debugging Solr Queries
If all components are able to communicate correctly but end users are still missing content in the site you should use the Solr Admin Console to debug the query used by Crafter Engine to search documents.
http://SOLR_HOST:SOLR_PORT/solr/#/SITE_NAME/query
More information about Solr Admin Console & query syntax can be found here.
Configure Ports
CRAFTER/bin/crafter-setenv.sh
export DEPLOYER_PORT=${DEPLOYER_PORT:="9191"}
export SOLR_HOST=${SOLR_HOST:="localhost"}
export SOLR_PORT=${SOLR_PORT:="8694"}
export TOMCAT_HOST=${TOMCAT_HOST:="localhost"}
export TOMCAT_HTTP_PORT=${TOMCAT_HTTP_PORT:="8080"}
Configure Crafter Studio: Crafter Deployer URL
To set the Deployer URL, simply change the Deployer port in the crafter-setenv.sh
file.
CRAFTER/bin/crafter-setenv.sh
export DEPLOYER_PORT=${DEPLOYER_PORT:="9191"}