Update Xapian to use hooks rather than patching core
singularo - February 22, 2009 - 11:30
| Project: | xapian |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Description
After looking at Apachesolr recently, I was inspired to do some more work on the D6 port of Xapian, including making it so that the core patch is no longer needed.
Attached patch moves all Xapian config into the core search page, but in its own fieldset, allows hiding of std node search, and xapian taking over, and uses std search hooks for the module itself.
| Attachment | Size |
|---|---|
| xapian.diff | 17.7 KB |

#1
I think the idea is excellent! Unfortunately, however, I just ported a bunch of fixes from the 5.x tree and your patch no longer applies. 3 hunks fail.
#2
I manually fixed the failed hunks and created a new patch, attached.
#3
You'll also need to flush the menu cache for this to work for people already using the module -- I've attached a new patch.
The "Xapian only, hide drupal search" option does not seem to work, and should be better documented. If I search for something, I see three search tabs "Content", "Users" and "Xapian". Both "Content" and "Users" are provided by core search, why are they there if I have checked "hide drupal search"? And if they go away, does that mean I can't search users anymore?
Also, in the search results I see "node -" instead of "node type -" under each piece of content, which is less user friendly. (For example, it used to say "story - " and "page - ", now it simply says "node -".)
In any case, I think this is a huge improvement and should be committed ASAP -- we can continue to work out the remaining issues. Not having to apply a patch makes the module significantly more accessible.
#4
Hey, this patch is great! No more patch-core is going to save kitties :-)
Definitely a RTBC
I tried the patch on #3, and see xapian search is working fine.
I also make two little modifications:
- re-format results, allowing node type to be printed and making the results array similar to the one in hook_search() example implementation
- add condition to let xapian search on default search block when xapian_takeover is active
I make two independent little patches to easy review and rerolled main patch(hooks-insted-of-patching-core.patch) including them inside.
Thanks for the efforts inside this module :-D
#5
BTW:
I also notice the same behaviour, but after a cache clear it looks like it's expected(except for the tab that it's not selected).
#6
Hi,
I like xapian, and making it work with drupal is great :-) Thanks for the awesome work here
is there a way I would be able to help you with this?
maybe you need a co-maintainer hand? I can try :-)
#7
Committed to
DRUPAL-6--1branch :-)http://drupal.org/cvs?commit=293838