I noticed that both search_api_db and search_api_solr are required modules (panopoly_search.info). I'm always trying to reduce the number of enabled modules on a site especially when they aren't used. This seems like a good example. A site is usually using one or the other but not both.

I'm not sure what the most common use-case will be for panopoly based sites, but is there a way to change this so that both are not required?

We could probably do a couple of things...

1) Provide an option (with default) during installation.
2) Provide a configuration form to change which is used.
3) When a change is made in #2 then we enable / configure appropriately.

I could see the DB being the default option as any site can use it... but not every site will have access to Solr.

Comments

liza’s picture

i've never understood what do these search modules have anything to do with using panels. i feel that there should be a real core to panels and then features like these just become options/enhancements.

lsolesen’s picture

@liza Panopoly isn't just panels - and it is created as a submodule for panopoly, namely panopoly_search. So you can easily just disable that module.

@caschbre I agree. Could you take a stab on making a patch which includes your proposed changes?

caschbre’s picture

Yeah, I'm fine making a patch. I just want to make sure the idea is good before I spend time on it. :)

caschbre’s picture

Assigned: Unassigned » caschbre

Assigning to myself, however I'm going to wait until we get more feedback from the maintainers before I try and create a patch.

mglaman’s picture

What if it was taken out of .info as dependency and enabled them on hook_install? It's just the servers. The features should just be built around the index, which can have a missing/broken server.

caschbre’s picture

Here's what I've been able to do so far...

* Removed search_api_db and search_api_solr from the .info files.
* Created panopoly_search.profile.inc with an install task to choose a Search API service (db/solr).

The site would not install with just that, so had panopoly_search.install enable both modules thinking that during the service selection I could uninstall the others. I can manually disable either module without issue, however if I try to uninstall search_api_solr or search_api_db the panopoly_search module shows as overridden and the site throws errors.

I'm guessing it is because of panopoly_search_default_search_api_index() and panopoly_search_default_search_api_server().

I've been contemplating creating panopoly_search_solr and panopoly_search_db sub-modules to contain the feature exports but not sure that's really the way to go. (on a side note if you change anything about the server or index the module shows overridden... probably not good.)

Any thoughts on how to proceed?

dsnopek’s picture

Title: Are both Search API DB and Search API Solr required modules? » Split into sub-modules panopoly_search_db and panopoly_search_solr
Category: Support request » Feature request

Yeah, I think this would definitely require making sub-modules like panopoly_search_db and panopoly_search_solr. I've also added this to my personal notes for Panopoly 2.x. Getting this in for Panopoly 1.x will be a little harder because we'll need a good upgrade path that doesn't disrupt existing sites.

dsnopek’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev

Moving to 8.x-2.x where we could realistically make this change!

amaisano’s picture

We get a few errors from our disabled solr index/server (we use the normal db server), and would love to simply disable the whole solr bit, but it doesn't seem possible without losing all search functionality provided by Panopoly.

We're on 7.x for a bunch of our sites, but I see this 'fix' likely won't be in 7.x.

Is there anything I can do to further disable/remove the solr aspect of panopoly_search nicely in the meantime on 7.x?

Some errors, even though I'm not using solr for anything:

SearchApiException while deleting items from server Solr Server: "0" Status: Request failed: Connection refused in SearchApiSolrConnection->checkResponse() (line 541 of /srv/www/tierone/master_checkout/public_html/profiles/panopoly/modules/contrib/search_api_solr/includes/solr_connection.inc).

SearchApiException while retrieving config files of Solr server Solr Server: "0" Status: Request failed: Connection refused in SearchApiSolrConnection->checkResponse() (line 541 of /srv/www/tierone/master_checkout/public_html/profiles/panopoly/modules/contrib/search_api_solr/includes/solr_connection.inc).
dsnopek’s picture

Status: Active » Fixed

This split is now in the 8.x-2.x branch via #3224314: Start implementing panopoly_search for Panopoly 2.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.