Removing Solr

39 views
Skip to first unread message

Jason Horsman

unread,
Apr 27, 2021, 3:14:20 PM4/27/21
to CrafterCMS
I created a crafter site a few years back now and when I did it was using solr for searching. Are there steps available somewhere for removing search and solr? We didn't end up fully implementing search in our site and right now I want to get rid of the solr requirement for our site. I can then try building an adequate search using the current 3.1.x release of crafter with elasticsearch when we get time. Thanks.

Jason

Jose Ross

unread,
Apr 27, 2021, 3:29:48 PM4/27/21
to CrafterCMS

Hi Jason,

There is no way to remove Solr from the bundles, but only Elasticsearch is started by default so it will not consume any resources. If your site has code related to `searchService` you can comment it out and it will run without issues in newer versions of Crafter CMS.

You can find a guide to migrate from Solr to Elasticsearch here in case you need it: https://docs.craftercms.org/en/3.1/developers/cook-books/how-tos/migrate-site-to-elasticsearch.html

Regards

Jason Horsman

unread,
Apr 27, 2021, 3:32:43 PM4/27/21
to CrafterCMS
Sorry, I'm not looking to remove it from the bundles. I am simply trying to remove it from my crafter content that I created so that I no longer will have to start crafter-authoring using the withSolr flag. I've looked at the guide to migrate from Solr to Elasitcsearch and it's not helping. That's why I thought I would try a different tactic of just removing search or solr from my site content instead.

Jose Ross

unread,
Apr 27, 2021, 3:41:50 PM4/27/21
to CrafterCMS
In that case you should look in your site for uses of `searchService` and remove them or comment them out, as long as your site doesn't call that service it will not try to communicate with Solr and you can leave it stopped.

Jason Horsman

unread,
Apr 28, 2021, 11:15:50 AM4/28/21
to CrafterCMS
Thanks for the help so far. I have been removing anything that I feel is related to search and I'm still getting a failure to create my site. The exception I see in the crafter-deployer.out file is:

nested exception is org.craftercms.search.exception.SearchServerException: Create index 'removesolr-preview' failed: [] {"message":"Service unavailable, please try again later"}

Which is what I was getting before when I didn't have Solr running. Do you have any other ideas for things that would need removed? Or is there something I can look for in the crafter-deployer.out file to see what file is still causing it to want to use solr? Thanks again!

Jose Ross

unread,
Apr 28, 2021, 11:54:56 AM4/28/21
to CrafterCMS
I think this is a missing configuration, check if your site has a `craftercms-plugin.yaml` file in the root of the repository (if not you will need to add it, you can copy one from our built-in blueprints and update it). The file should contains this:

searchEngine: Elasticsearch

Jason Horsman

unread,
Apr 28, 2021, 3:07:18 PM4/28/21
to CrafterCMS
Thanks that seemed to be the final piece that I needed!
Reply all
Reply to author
Forward
0 new messages