It would be great to be able to export/import and ideally save faceted search environments to files to ease moving environments amongst servers (dev, qa, prod etc).

CommentFileSizeAuthor
#4 faceted_search_export_names.patch24.51 KBDavid Goode

Comments

dawehner’s picture

i would like to have this feature too.

Perhaps it would be possible using

Exportables -- tools to make it easier for modules to have objects that live in database or live in code, such as 'default views'.

From Ctools Module

dawehner’s picture

Status: Active » Closed (duplicate)
dawehner’s picture

Status: Closed (duplicate) » Active

sad its not

David Goode’s picture

Status: Active » Needs review
StatusFileSize
new24.51 KB

Hey,

We needed this functionality to work on a site over here, here's a preliminary patch that supports it. It is fairly extensive, requiring the module to use names rather than ids to reference environments. Test it out, and if changes are needed please advise. Look at faceted_search.module for how to define an environment in a code hook--use hook_faceted_search_env_define() and basically take what you get from the export box. This is very similar/modeled after the views workflow. Outstanding stuff:
1) There is no caching of code-defined environments a la views--this could be added.
2) There were some API changes. One goes from faceted_search_get_env_ids() to faceted_search_get_env_names($disabled = FALSE). The new one returns names rather than ids, and also accepts an argument to load disabled environments (only used on admin page). This will break some modules, like context_facets, but they will just require the function to be renamed. It could go without a rename, but if it is implemented in a more complicated manner (other than always listing and loading with api funcs) it could get messed up. faceted_search_env_load now also takes a name rather than an id.
3) More testing is needed, especially with any implementing modules that go beyond defining a filter, a process who's API was luckily unaffected by this change.

Thanks,
David

q0rban’s picture

Subscribing

phayes’s picture

subscribing