Closed (fixed)
Project:
Acquia Connector
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2011 at 19:42 UTC
Updated:
26 Jul 2012 at 11:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
nick_vhI just tried this and the clone button allows you to clone the environment. This means that as a site builder you can clone the Acquia search environment and do whatever you want with this new environment.
The only problem so far is that you can modify the URL, but maybe that is not even a problem
Comment #2
cpliakas commentedYes, you can clone it, however you do not get the Acquia Search specific settings (i.e. the choice to use the eDismax handler) because the logic is hard coded to the original "acquia_search_server_1" environment ID. It is also a non-intuitive step to force our customers to do if they want to add another environment that connects to their Acquia Search index.
The attached patch allows you to create new environments that connect to your Acquia Search account. I added a checkbox that says "Connect to Acquia Search" to simply the process. If we do end up supporting connecting to multiple indexes via the GUI, then the URL can be replaced with a list of indexes you can connect to or something.
Comment #3
cpliakas commentedRemoving my local testing hacks :-(
Comment #4
cpliakas commentedMarking as needs work, because when you create a new environment the description defaults to "Acquia Search" no matter what is entered.
Comment #5
cpliakas commentedResolved issue with not being able to change the description for the new environments connecting to Acquia Search.
Comment #6
cpliakas commentedChanging to needs-review...
Comment #7
nick_vhCan't we make this check less cryptic?
Or at least cleaner?
Would be good if the Environment name is not changed, but altered. For example : Environment 1 (Powered by Acquia Search)
Convenience instead of conveniance?
Also I'd like to know if this makes it possible to connect to two different subscriptions? I would think not, since the subscription id's are kept in the connector.
Comment #8
cpliakas commentedI'm always up for better readability of code. What do you suggest?
I'm not sure I agree. I'm not sure I disagree, either :-). As a site builder I absolutely hate when things that I enter via the GUI magically get modified. However, when viewing the list of environments I see how it would be helpful to show which ones are connected to Acquia Search. Note that the default behavior forces your Acquia Search environment to have the description of "Acquia Search". This patch maintains that functionality for the environment created by the module, but allows custom environments added through the GUI to have custom descriptions.
My wife is a first grade teacher. It is a known fact that her students are more competent spellers than I.
To me this is a precursor to that functionality. In order to connect to multiple subscriptions, you have to support connecting to multiple Acquia Search connected environments first. To me that is a separate issue, though, and we should get this one working first before tackling that one. I do agree that the multiple subscription problem is bordering on critical based on how people are looking to use Acquia Search, and I would love to help tackle this as well.
Comment #9
nick_vhThis can probably be 1 check instead of 4 different ones.
Most of the other ones can be checked individually and return false or exit the function?
What about some kind of color/visual view that it is connected with Acquia Search? I guess you could also add the Acquia subscription ID to the environment, but that is not future proof since we want multiple indexes per subscription ID soon.
The default behavior currently also disables your current default search index, even though you added another environment and you do not want the acquia search be the default, did you disable that? Maybe I missed that. What I actually envision is a question to the user that asks : Do you want Acquia Search to be your new search environment?
Thanks for the work!
Comment #10
cpliakas commentedI'm cool with this, but at the same time that might best be done in a separate issue. My patch didn't introduce that, so I don't want to impose any collatoral damage as a result of unnecessary changes.
Maybe a little Acquia Search icon in front or behind the environment description? That would be fun :-) I wonder what the UX people would suggest here?
Regarding the default behavior, I tried not to disturb that at all, and I am pretty sure I accomplished that. So it should work exactly as it does now in terms of when you enable the module. The only difference is that you can now add environments that connect to Acquia Search. When you add those environments manually, it works like any other environment in that you have to set it as the "default" manually if you want this behavior.
So just to spell this out more clearly, when you enable the module it will go through it's normal process of connecting to Acquia Serch, making it the default environment, etc. With the patch, you can now simply add more environments that might or might not connect to Acquia Search. Doing so will not set these environments as the default automatically, just like if you were adding non Acquia Search environments.
Comment #11
nick_vhCreated a complete different approach to this problem
Solves : Cloneability + allows you to connect to a different acquia network subscription if you would like to.
It also takes care about the naming issue. Disclaimer : I've done this on a train trip so don't judge me on the quality just yet, I did not have internet connection!
You are allowd to delete a cloned acquia environment, you are still not allowed to alter the url. You can alter the sub and key id per acquia search environment.
Possible todos is a little checkbox that asks if this should be an acquia search sub or not, might be easier than checking the environment on a certain name syntax, similar to cpliakas's patch
I should probably merge this with Chris Pliakas's patch about the edimax per environment.
Comment #12
nick_vhattaching a revised patch with a small correction
Comment #13
cpliakas commentedThat's awesome. So if you have multiple subs this makes it possible to connect to them via the UI?
+1. The goal of my patch was to make it trivial to connect to Acquia Search without having to look up information. I hope we can find a way to maintain that one piece.
Comment #14
nick_vhEasily, see the following screenshots (sorry for the ridiculous names)
https://skitch.com/nick_vh/er2dh/drupal-nl-irc.freenode.net
https://skitch.com/nick_vh/er2r8/search-and-metadata-smartphone-compare
https://skitch.com/nick_vh/er2rm/search-and-metadata-smartphone-compare
https://skitch.com/nick_vh/er2rx/apache-solr-search-smartphone-compare
I don't think it is intrusive or complex at all, the only trick to keep it an acquia subscription is that you have to clone it from the sub that was originally added.
Comments welcome
Patch included with small namespacing fix
Comment #15
nick_vhso, I finally merged the two patches. Cpliakas, I had to remove a bunch of your custom variable settings and I moved it to the generic saving mechanism for environments.
This means that the db is a bit less bloated and or custom :-)
Also fixed some of the flaws that were pending in this patch. Please test it and report back.
Comment #16
nick_vhchanging version
Comment #17
nick_vhwhen the checkbox is marked :
https://skitch.com/nick_vh/er9a2/apache-solr-search-smartphone-compare
when the checkbox is unmarked :
https://skitch.com/nick_vh/er9ah/apache-solr-search-smartphone-compare
when the module is disabled it will remove the added environment and will unset any acquia specific configuration in the remaining environments.
Comment #18
nick_vhimproved the description for the custom connection a bit and added a link to the Acquia Agent
Comment #19
cpliakas commentedFirst, great work! Exciting feature.
On a clean install, the first time I visit the search page I get an "Undefined index" error since the
$environment['conf']['acquia_search']is not yet set inacquia_search_form_apachesolr_environment_edit_form_alter(). This error is also thrown when you apply the patch, so it will happen when users upgrade the module.From a UX perspective, my opinion is that the fieldset text should be changed to something like "Connect using another subscription" or something similar, as "Configure Acquia Search" implies that you have more configuring to do. You also have to read the help text inside of the fieldset to know that these fields are not required unless you are connecting via another subscription. Based on various usability studies, we know that in general Drupal users don't always read the help text :-).
Also, I still think that the checkbox should be at the top of the form. If the Acquia Search module is installed, the site is most likely using Acquia Search. People generally start configuring forms from the top down and rarely scan through the whole thing prior to filling out the fields, so it isn't apparent there is an "easy connect" checkbox until after they have configured the difficult parts.
Not critical, but it would also be cool if people could enter their email address / password to get a list of subscriptions similar to when you first configure the Acquia Connector. That might be a little more complex to do so might be a good follow-up issue.
Thanks,
Chris
Comment #20
pwolanin commentedI think connecting to multiple subscriptions is an edge case we shouldn't support in the UI. If it was to be supported via the UI, I think that would belong in the connector?
It might also make sense to take the DERIVED key here?
Comment #21
coltraneMinor, but better to check access first, so as to fail quickly if access is denied.
Is the default localhost?
Funny, but maybe leave it out?
Comment #22
cpliakas commentedAlso, after talking briefly to pwolanin, it looks like the derived key might be an issue. Different subs might have different salts, however the
_acquia_search_derived_key()function assumes that the same salt is being used by the default subscription. Therefore there might be a derived key mismatch here causing authentication failures.Comment #23
pwolanin commentedWorking on re-rolling to just used the derived key - will also roll a patch to apachesolr to let you get/set/del environment variables via drush, so we can skip the UI.
Comment #24
cpliakas commentedInstead of moving forward with this in a few different directions, it might be worth taking a step back and re-thinking the low-level API functions that are required. As part of the work being done for Acquia Search for Search API, I had to duplicate a lot of the authenticator / derived key logic as to not require a deep rearchitecture of this module.
Instead of patching what we have, it might be worth removing the single credential assumptions of the low level stuff and moving it to a library or set of functions that could be leveraged by Acquia Search or Acquia Search for Search API. We have an opportunity to take the API-based approach first and then at least have the ability to build a UI on top of it later.
I really hope we don't commit a solution that isn't at least open to the possibility of a UI on top of it. Although this is an edge case now, it is in a small part due to the fact that it is very difficult to do unless your Drupal ninjutsu is well established.
Comment #25
pwolanin commentedDeveloping a useful UI would require work in the acquia_agent module so that it could hold and manage multiple network connections, I think.
issue for variables: #1673086: Add drush commands to get, set, del environment variables
Comment #26
nick_vhI'm not in favor of rethinking this massively. Don't re-architecture if it is not needed at the moment, and also not because we can. If you want to do this, it should be in a sandbox and not in this issue. Do you really think Acquia Search for Apachesolr + Acquia Search Api is a good module combo? I'd keep them together. It would probably not be meaningful enough and only makes the clutter bigger if you start generalizing that out.
Also, I really like the small UI for connection to another subscription, since that makes managing multisites so much easier. However, I'd be ok with removing this, I could easily make that a small custom add-on for the sites that need it.
So, can we focus and not drift off to a general API discussion in this thread?
In regards of the derived key, it is a generated one, so I'd be ok with storing the derived key and using that along the flow but the id and key combo is way easier to use. In UI and in code.
Goal for this patch :
make it easy to clone an acquia search sub
Allow multiple acquia environments
Allow somehow connections to another subscription using an ID/key and/or derived key combo, imho a key/id combo is easier for external developers to understand.
Thanks for all the input :-)
Comment #27
cpliakas commentedNot re-architect. Refactor based on existing customer need and pain points. The fact that there are (at least) three versions of code that establish connections to a second subscription highlights a need for this.
I'm not sure we are on the same page here. All I am saying is that we have an opportunity to consolidate and reuse code. If that is not in the cards, then we can have two separate lines of development. That is not necessarily a bad thing, but when I see an opportunity to align I feel it is necessary and productive to at least bring it up.
Sometimes staying the course is a good idea, other times it is not. The only way to know is to discuss :-)
Regarding the goals, it might be useful to highlight the target audience. For example, is this for power users, non-technical users, others? I have a specific persona that I am interested in, which is why I am focusing on certain areas that might not align with your target audience.
Thanks,
Chris
Comment #28
pwolanin commentedHere's a more stripped down patch. Check some of the basic functionality, but needs more review.
A bunch of problems with the one above - especially you need the existing hook_acquia_subscription_status() implementation, or the acquia seach environment is never created if you enable before configuring acquia_agent, or if you've ever deleted and re-added key to the agent.
Comment #29
pwolanin commentednow with a patch...
Comment #30
coltraneI don't feel familiar enough with Acquia Search or the code to mark this RTBC yet but I can say the patch applied fine and I haven't seen any errors.
Here's what I did:
* Installed apachesolr, applied this patch, and enabled the modules
* Once the service was ready I cloned the Acquia Search environment and made it default
* the search/site page was set to used the cloned environment, and a search on that page came back with results
Regarding a re-architect/refactor of the connection code, I agree with Chris but unless you all are willing to wait on this feature for that I'm ok getting this in and coming back to a refactor in a separate issue.
Comment #31
cpliakas commentedI am all for pushing ahead to get the feature in and refactoring later.
I do think the patch in #1190890-29: Support multiple search environments for the same AN subscription works and provides the API-like functionality (for Apache Solr Search Integration at least) to connect to multiple subscriptions. It cannot be reused by the Search API integration module, but we can tackle that later. The original intent of this issue was to have multiple environments connect to the same subscription, but somewhere along the line it evolved to supporting multiple subscriptions as well which is the only reason why I brought it up.
I still don't like that we took the UI completely out of the equation, and I also don't like that you have to clone an environment and cannot use the "Add new environment" link like you could in #1190890-5: Support multiple search environments for the same AN subscription. From a UX perspective I really liked the one click "Connect to Acquia Search" checkbox. I think it simplified the process since the "Add new environment" link is probably the first thing users will click on since "clone" is hidden way on the right of the page in a slop of other links.
In addition, I don't like that you have to know your second subscription's derived key and add it via drush through an environment variable (or some other method) to connect it to Acquia Search. It is not trivial to get the derived key, and having to use drush to set it seems unnecessarily complex. I have made my point of view known, so I am not going to continue arguing it. If the decision is made that this is fine, I'll drop it for now.
With all that being said, the original goal of this issue is accomplished by cloning the environment. It also has the added benefit of connecting to another subscription if you know how to get second one's derived key, which is a huge step forward over the current code. I know I sound cranky, but I do appreciate the efforts and advancements made in #1190890-29: Support multiple search environments for the same AN subscription. Marking this as RTBC since I did test the cloning functionality and connecting to multiple subscriptions. I also think it is flexible enough to add a UI on top of going forward.
Thanks,
Chris
Comment #32
pwolanin commentedcommitted to both 7.x branches - needs to be ported to acquia_search 6.x-3.x
Comment #33
pwolanin commented#1677418: Support multiple search environments for the same AN subscription
Comment #34
nick_vhmissing default value, should always be there Also problematic when porting to the D6 version.
Actually, it should be apachesolr_default_environment() instead of the variable_get
Comment #35
nick_vhfollow-up patch
Comment #36
nick_vhcommitted to 7.x-2.x