You can also read the issue title as "@eaton's talk at DCDC 2 years ago has just sunk in".

Recent [cool!] feature requests among with some WTFs would be deeply helped by refactoring the way the code is laid out. For instance:

So it'd be nice to APIfy suggestions to recieve, other than a search string/fragment to suggest on, a set of active filters to apply for suggestions, and the field to base suggestions of off.

This would enable:

  • Views search box(es) for different fields, plus (in theory) respecting any predefined filters for the View.
  • Replace or complement existing "Filter by XX" facet blocks with an autocomplete field.
  • Other stuff??

This task would probably end up generating a 2.x branch for both D6 and D7.

See some suggestions from @kmadel at #1061234: Better Integration with Apache Solr Autocomplete

Feedback would be welcome!

CommentFileSizeAuthor
#2 1062818_apachesolr_autocomplete.patch3.31 KBjanusman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

janusman’s picture

janusman’s picture

Small patch that just removes hardcoded use of "spell" field. Lots work left to do.

GaëlG’s picture

I'm interested in helping a bit with this, as I'd need the autocomplete feature working together with Apachesolr Panels. Could you please give some more advice ?

broncomania’s picture

Yes I agree this is a must be. I ran into a problem that cck fields are used for suggestions but I want to exclude them. It's a link field and gives really useless suggestions to me. So what will be nessesary to apify this module?

janusman’s picture

@broncomania: re #4: your problem might be a different one; perhaps you need to:

  • alter the suggestions after they're generated but before they're shown to the user?
  • remove the link field entirely from the search index? If not you will still get *spellchecker* suggestions for those (well, unless you have that switched off).

The hard part is that for the latter, we have the general problem that this needs a schema.xml change, and Apache Solr Integration module (and others like mine) don't have a user-friendly (meaning, GUI-oriented) way of changing the schema. So anything like creating a new field to base suggestions off of needs manual editing of schema.xml, and thus complete reindexing by Solr...

If you're willing to do all of the aforementioned things, then perhaps you can go ahead and do it, and hack apachesolr_autocomplete to use that new field (which is slightly easier using the patch from #2).