Subscriptions mail from Apache Solr search module created using the same hook as Subscriptions mail from view. The table accepts the fq parameter. The query is fed into apachesolr_search_run.

I created this so we can add a Save this selection to the bottom of a search form based on Apache Solr search. The selection can be replayed at any time.

Comments

peterx’s picture

StatusFileSize
new12.69 KB

This has an insert function you can call from your form code.

peterx’s picture

I have a site specific search page submitting requests to a URL, the URL in a site specific menu hook, the requested page inserting through the insert function of the module class, and the request working in cron.

The site specific code translates some field names from their local name to the Solr name. Some term ids are replaced with term names because the fields are in ranges and the term names are in sequence, not the term ids. I might extract some of the local code into class methods to handle common requirements.

One thing left to do is handle multiple selections. The site does not have any in the test script.

peterx’s picture

I made the table viewable and tested it by creating a view. Will upload the expanded code one day. On my current project, we want one list for the admin, to show all saved searches, and another for the user to see own searches.

salvis’s picture

Status: Active » Needs review

That looks very interesting, too, but let's start with #1668944: Theme per mail and #1674310: Subscriptions mail from view.

Status: Needs review » Needs work

The last submitted patch, subs_solr.patch, failed testing.

peterx’s picture

StatusFileSize
new14.68 KB

Here is patch after a Coder review and changing null to NULL. I will add the view stuff from _solr to _view then submit the final patch for the _view module.

salvis’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, subscriptions_mail_from_solr.patch, failed testing.

peterx’s picture

I am working through use cases and testing at a site. I saved the last stable code to http://drupal.org/sandbox/peter/1697172 and will add the next iteration in a couple of weeks. Work stopped on the view version while I work through all the tests on the solr version.

Solr has two ways of searching with similar, but different parameters, and neither works reliably for anything more than simple basic beginner stuff. I also have to add a field list option because Solr is inconsistent in what it returns. The problems are similar to trying to make joins work in Views.

Everything shared between this module and the solr module is moved out to Subscriptions mail from.