TROUBLESHOOTING INDICES - pantheon-systems/search_api_pantheon GitHub Wiki
Home | Best Practices | Fun With Indices | Installation | Jargon | Local Development | Processors | Troubleshooting Indices
This document answers the question: "I have everything installed and my server says "can be reached" but my index isn't returning any documents when I search. What do I do?"
Troubleshooting your search_api_pantheon
search results:
-
Get all the errors and warnings out of your theme files.
When
search_api
goes to index the content, it's going to render the content using your theme. if there are errors or warnings in your theme, this will prevent your content from being correctly indexed. -
I know you blew through that first item and were like "This can't possibly be the problem." No, seriously. Stop now. GET ALL THE ERRORS AND WARNINGS OUT OF YOUR THEME. This is important. Poor theming will result in incomplete indexing.
-
Verify a server round trip is working correctly.
Using terminus run the drush command "search-api-pantheon:diagnose".
terminus drush {site_name}.{env} -- search-api-pantheon:diagnose
This command diagnoses problems with connections and can sniff out where the problem exists by what part of the command fails or succeeds. If the command completes without error, the connection to the server is working and you're ready to index.
-
Do you have, or did you create an index?
In order to return search results, your search server has to have at least one "index". Your index must index content from at least one datasource (ideally, "content") and you must choose "pantheon"'s driver as the server for that index.
-
If you have special permissions on your content, make sure the index is created with the correct user context.
We recommend that your search results index "FULL CONTENT" views of all content types.
-
Once you have established the index, you will need to add fields. We recommend that unless you know what you're doing, add the "rendered content" field and the "uri" field.
-
Anytime you make a change in the server's fields, you will need to re-send all of your content from the site to the Solr index for indexing.
-
Ajax errors when indexing:
When you choose "index now" what is happening is
search_api
is going through each of the indexed entities and rendering it with your theme. That means, if there are errors or notices in your theme, the indexing process may error while rendering the node and you'll get ajax errors like the one here.Check the drupal error log for where the error is and resolve the theme errors to resolve issues with the indexing process.
-
"My View still doesn't pull back any search results"
Create a new view from scratch that uses no theming and just does a fulltext search. Then try the search using various users searching for multiple words that are known to exist in a node. You can usually figure out what's going wrong with the view this way.
Also, you can check if Solr actually has items for your index by running the drush command "search-api-pantheon:select":
terminus drush {site_name}.{env} -- search-api-pantheon:select "*:*"
You could send more complex queries and other options to Solr index, just keep in mind that the way that Drupal builds the queries is usually very complex. You could append
?debug=true
to any Drupal url that uses Solr to get debugging information. Part of that debugging information is the Solr query that was sent to Solr; you could copy it from there:Then, decode the query parameter (you could use https://www.urldecoder.org/) and send it to Solr like this:
terminus drush {site_name}.{env} -- search-api-pantheon:select '(tm_X3b_en_body:("vegan")^1+tm_X3b_und_body:("vegan")^1+tm_X3b_en_field_recipe_instruction:("vegan")^1+tm_X3b_und_field_recipe_instruction:("vegan")^1)'