Solr provides a complete replacement for the built-in search engine, so why retain a dependency on the core search.module? Right now, if I'm reading this correctly, if you want to only use the Solr search engine and not waste the database & system with unwanted search.module calls you have to run a basically hack core to remove certain lines out of search.module (using CoreSearch.module)? Obviously, this is a bad situation, advocating hacking core is not a good thing. Why not just duplicate the functionality that's needed out of search.module and drop it completely, leaving a much cleaner system?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | not_so_fast_mr.patch | 979 bytes | robertdouglass |
| #6 | hook_cron.patch | 857 bytes | robertdouglass |
| #4 | kill_search_data.patch | 868 bytes | robertdouglass |
Comments
Comment #1
JacobSingh commentedhttp://drupal.org/node/405206
Comment #2
damienmckennaThanks. I searched but didn't include "fixed" in the criteria so didn't find this one. Glad to see it.
Comment #3
robertdouglass commentedWe need to go ahead with the original intent of this issue and completely decouple our module from core search. Core search enforces way too many assumptions and limitations. For example, we call search_data() for no good reason... all it does is invoke our apachesolr_search_search hook. Then, we use the standard theming for core search results. This breaks if you want to display more or less than 10 results per page because the THEME layer assumes 10 items (core search has this assumption hardcoded in many places):
So I'm reopening the issue with the original title and original intent.
Comment #4
robertdouglass commentedHere's step one. Instead of calling search_data, call apachesolr_search_search directly. Eventually I'd like to refactor apachesolr_search_search to be individual functions and not related to search module's API.
Comment #5
moshe weitzman commentedsubscribe. still a big fan of this direction.
Comment #6
robertdouglass commentedAnd another baby step. Don't depend on search.module to call cron for us.
Comment #7
robertdouglass commentedCommitting these two patches. More to come.
Comment #8
robertdouglass commentedOk. These are truly baby steps. That last patch broke things so I have to pull in some of the code from search_data to compensate. One layer of extrication at a time :(
Comment #9
damienmckennaHow about a patch that clears the core search_* tables on cron?
Comment #10
robertdouglass commentedDamien, what would such clearing accomplish? Just "truncate search_index" and so forth? And, why would we need to do that every cron run?
Controlling core search behavior isn't really the purview of the ApacheSolr module, imo.
Comment #11
geerlingguy commentedSubscribe. search.module's cron is never happy, and I have to manually trigger it (using Elysia cron) in order to get the apache index to be updated. I vote to get rid of search.module when using Solr.
Comment #12
ManyNancy commentedI think my issue is a duplicate. #719902: Less branding please
I hope part of the direction here is to remove the apache solr branding from search, and just use 'search'.
Comment #13
moshe weitzman commentedyou can change urls with aliases or with hook_menu_alter(). anyway, changing urls is not a goal of this issue. feel free to keep the other one open.
Comment #14
geerlingguy commentedIn the mean time, is there a way (besides hacking search.module) that I can simply have search_cron *not* do its indexing process and build a huge database table (which is the primary cause of my site's inability to run cron)?
Comment #15
robertdouglass commented@gerlingguy - no, you have to hack core. Either use the coresearches patches, or just go in and add return FALSE; to the indexing functions.
Comment #16
geerlingguy commented@robertDouglass - okay. Hopefully this issue picks up a little steam soon, then. I hate killing kittens!
Comment #17
Macronomicus commentedDoesnt http://drupal.org/node/405206 which has been commited already have a fix so core search doesnt index anything? I have my core search index setting set to zero.
Comment #18
drewish commentedsubscribing. we've got several hundred megs of search indexes that we'd love to stop moving around in database backups.
Comment #19
robertdouglass commentedThe three patches here are committed. Let's open a new issue for remaining tasks.
@drewish - to prevent search.module from indexing you can set the number core search is to index per cron run to 0.