Closed (fixed)
Project:
Apache Solr Search
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 May 2010 at 14:25 UTC
Updated:
11 Dec 2010 at 19:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
jpmckinney commentedLike tjwallace said, this is not a finished port. Many theme functions and queries still need to be rewritten.
The current patch removes _sendRawGet and _sendRawPost from Drupal_Apache_Solr_Service to get search working. We may want to track down how these functions were causing search to fail.
There are at least four TODO/XXX in the current patch that need to be fixed.
Here's my review up to apachesolr_search.admin.inc in the patch:
DONE: The .info part of the patch won't apply as the patch is against a downloaded version of the module, rather than against CVS. Also, need to add:
"Index Actions" was changed from a header to a fieldset, as the new FAPI wasn't accepting the old format. Perhaps someone more familiar with the D7 FAPI can restore the header.
I'm not sure what the appropriate $build_mode argument to node_build_content should be.
DONE: Be careful about codings standards http://drupal.org/coding-standards e.g.:
DONE: Make $nid plural here. Also, there's no need for the quotes around :new and :old, I think (occurs elsewhere, too):
DONE: What happened to $excluded_types? (see SQL injection comment)
RETRACTED: Change :last_change to :last_changed (occurs elsewhere):
DONE: Don't call time() twice, as it may not be the same time:
SQL injection possibility?
DONE: Should be removed. Let Solr autocommit:
DONE: I think
joinis synonymous in DBTNG withinnerJoin, so I prefer the shorter method name:DONE: Expand $na into $n_alias (occurs more than once):
DONE: Respect 80-column limit for comments as in original code:
hook_node_delete and hook_node_update don't take a second argument. If $set_message is being used, we may need to do some refactoring to keep that functionality:
Comment #2
tjwallace commentedOk I have applied most of jpmckinney's comments. I also have gotten search results to show up now!
Comment #3
pwolanin commentedgreat - I will try to put a version of this into CVS HEAD tonight.
Comment #4
BenK commentedGreat work... subscribing...
Comment #5
janusman commentedAwesome!
Comment #6
davidseth commentedI have been keenly waiting for this! Great Work! I will see if I can help out, can anyone give me some pointers as to where they would like some help?
Comment #7
pwolanin commentedpage callbacks should return structured data - this looks rather wrong:
Comment #8
pwolanin commentedsome other parts of the patch don't apply:
apachesolr_search.module.rej
apachesolr.module.rej
Comment #9
pwolanin commentedcommitting parts of the patch that apply (with a few tweaks) to CVS HEAD - it's surely pretty broken, but as least then we can all work from a common checkout.
Comment #10
pwolanin commentedComment #11
jpmckinney commentedDid you sync HEAD with 6.x-2.x before applying the patch? The patch may not have applied cleanly because HEAD was behind the latest 6.x-2.x. EDIT: Nevermind, having checked the CVS log HEAD was indeed synced with 6.x-2.x.
Comment #12
jpmckinney commentedChecking the CVS log http://drupal.org/project/cvs/204268, it looks like a different patch was applied than the one in this thread: http://drupal.org/cvs?commit=365998 That's fine with me, I'd rather not commit this patch right away.
Comment #13
pwolanin commented@jpmckinney - I started with the patch above, but made a few manual edits. For example, not removing the methods overrides to use drupal_tttp_request() since we need to make that work. Also made some edits to the .info files.
Comment #14
jpmckinney commented@pwolanin When I look at the commit, I only see changes to files within the contrib/ directory. I just checked out HEAD, and I can't find any trace of the above patch. Are you sure you committed it (or some parts of it)?
Comment #15
pwolanin commented@jpmckinney - you are totally right - I ran the commit inside the contrib subdir by mistake.
Just committed the rest.
Comment #16
robeano commentedThis is great! It looks like pwolanin made the rest of the commits just now. Thanks so much for getting the port to D7 jump started.
Comment #17
jpmckinney commentedI'm just confirming that the patch applied at http://drupal.org/cvs?commit=366106 differs with the last attached patch in Drupal_Apache_Solr_Service.php and in the .info files. It also differs in some changes to apachesolr_search_view, as cited in the apachesolr_search.module.rej failure above.
@pwolanin I don't see what part of the attached patch above would cause the patch failure for apachesolr.module.rej that you cite.
Comment #18
dmitry_bezer commentedNext step.
includes updates in theming DB access and taxonomy related code
Comment #19
pwolanin commented@jpmckinney - I'm not sure either about what caused the conflict, but that's easy to fix.
@dmitry_bezer Looks like Drupal core is using node_view() instead of node_build_content() for indexing : http://api.drupal.org/api/function/_node_index_node/7 so we sould revist how we are building content for indexing.
Also it would be preferable for all queries to use named placeholder:
also, db_query must only be used for SELECT - convert to db_update (or db_merge) for any update queries.
however, this looks like good progress, so committing to HEAD so it's available for further refinement.
Comment #20
dmitry_bezer commented@pwolanin - thank you for your comments,
So the next thing i'm going to do is change node_build_content() -> node_view() and convert all the queries into new style DB Api calls.
Hope I will post the patch soon
Comment #21
dmitry_bezer commented* non-select queries converted to DB API calls
* node_view() is used for indexing instead of node_build_content()
* "Use Apache Solr for taxonomy links" option is partially working now
Comment #22
pwolanin commentedthere is a minor white space formatting issue with:
COALESCE is not listed on http://drupal.org/node/773090 as a supported function, but I don't see an obvious alternative. A quick search suggests that MySQL, postgres, sqlite, MSSQL, and Oracle all support coalesce.
Also, I think ideally we'd use dynamic queries also for any query using JOINs
Comment #23
pwolanin commentedcommitting to HEAD with some white space cleanup. queries with joins need to be fixed still.
Comment #24
jpmckinney commentedCOALESCE came from this patch #650534-18: "Column 'changed' cannot be null query" watchdog error when attempting 'Re-index all content' when using MySQL InnoDB.
Comment #25
pwolanin commentedYes, I think we need the COALESCE, just looking out for DBTNG changes or weirdness - I'll ping Crell about it
Comment #26
dmitry_bezer commented* queries using joins converted (except ones in cck-related code)
* more taxonomy related fixes
* empty search page fixed
* minor improvements
Comment #27
pwolanin commentedI checked with Crell in IRC, and he says that dynamic queries are not required for simple JOINS in SELECT queries.
Some of these changes look like line endings are changing or trailing space added?
Comment #28
dmitry_bezer commentedline endings fixed
Comment #29
dmitry_bezer commentedfyi: I'm currently rewriting apachesolr CCK code into Field API. The patch is coming soon.
Comment #30
pwolanin commentedThanks. committed after removing a stray tab.
Comment #31
dmitry_bezer commentedInitial Field API support implementation. Actually just a reimplementation of old CCK code. Adds facets for fields of 'list', 'list_text' and 'list_number' types. Old CCK code is not removed yet. Any comments are welcome.
Comment #32
pwolanin commenteddmitry, can you explain a little more the new code in the patch?
Also, was this deliberate?
Comment #33
dmitry_bezer commentedAs i said, basically it simply reimplements the old CCK code. So actually there is no new code =) On indexing it adds to the solr document fields of certain types that can only contain predefined set of values. It also adds corresponding blocks you can use to filter your search results. This fields functionality is very similar to how taxonomy is used in search. Actually this adds the same functionality that you have for taxonomy (in terms of search) for any field with predefined values.
menu code: yes, it was deliberate. That line was added by mistake and caused problem with breadcrumbs
This new patch also fixes a minor problem with menu and removes some tab characters and spaces on the line ends.
Comment #34
pwolanin commentedLooks like apachesolr_cck_fields() is still used?
Comment #35
pwolanin commentedcommitting this patch - looks like a bunch of the admin paths need more work though. Let me take a quick pass.
Comment #36
pwolanin commentedcommitting this path fix-up patch.
Comment #37
pwolanin commentedminor changes to settings page UI + CHANGELOG, committed
Comment #38
dmitry_bezer commentedthanks Peter,
I realized that i forgot that submodules in apachesolr/contrib the still require some work. will post the patch soon
Comment #39
dmitry_bezer commented* lots of small fixes and improvements
* apachesolr_commentsearch and apachesolr_nodeaccess were also ported
Comment #40
dmitry_bezer commentedHere is what i think should be done next:
* remove old CCK code, it is still there only for reference.
* port the rest of submodules in contrib/ - I tried to port the apachesolr_date but was unable to install the dev version of Date module
* use it, test it, find bugs, submit patches =)
Comment #41
pwolanin commentedre-roll of the patch above with whitespace, etc, cleanup.
Also, reverted a part that's removing a date fix.
Comment #42
pwolanin commentedWow, working with this code is a real PITA (especially the new field API stuff).
As I dig into it, however, it seems clear to me that we should treat taxonomy terms via the Field API and hence remove a variety of the special casing for them.
Comment #43
pwolanin commentedGoing to commit this patch - moving in the right direction, though it's still a mess.
Comment #44
pwolanin commentedAnother iteration - committing this (not sure it works yet).
Comment #45
das-peter commentedAnother patch to get __makeHttpRequest running again. drupal_http_request has changed its parameter structure.
Comment #46
pwolanin commentedThanks, committed that
Comment #47
pwolanin commentedmore updates. committing to CVS
Comment #48
das-peter commentedTwo syntax issues fixed - introduced with latest commit ;)
Comment #49
das-peter commentedLooks like the commend module should be added as dependency in the apachesolr.info.
The method apachesolr_rebuild_index_table() relies on tables created by the comment module.
Another solution would be to check if the comment module is enabled and change the query if necessary.
But then there should be a way to detect if the comment module is enabled, to recreate the index table.
Comment #50
pwolanin commentedok, thanks - this is obviously a work in progress.
comment module shoudl NOT be required - the query was supposed to have been fixed to work in the absence of comment
Comment #51
pwolanin commentedreworking taxonomy so that it's handled as a normal field, fixed various bugs.
committing this to CVS.
Comment #52
pwolanin commentedHere's the APi change we've all been waiting for - put the params array inside the query object, and use the query object itself to execute searches.
Comment #53
pwolanin commentedcommitted #52 - but still looking for feedback on current progress.
Comment #54
pwolanin commentedHere's a change we should also make in 6.x-2.x: move the OR facet code to the finalize hook.
Comment #55
pwolanin commentedoops - that patch was backward. - use -R
committed it to CVS
Comment #56
pwolanin commentedtaxonomy fixes. Not really tested yet.
Comment #57
pwolanin commented#56 was already committed - here are some minor fixes after review with Robert. Committing to CVS.
Comment #58
pwolanin commentedCommitting this one line fix also:
Comment #59
yngens commentedthanks for the great job. subscribing
Comment #60
pwolanin commentedWorking with Crell - here's a big patch that makes Field API handling more generic, adds a framework for handling settings for multiple Solr servers, and moves the nodeaccess module out of the contrib dir.
Comment #61
pwolanin commentedFix up server add/edit/delete. Committed this to CVS.
Comment #62
pwolanin commentedfix up requirements checking, add button to test a set of server settings. committing to CVS.
Comment #63
pwolanin commentedoops - indexing code doesn't account for schema changes.
Comment #64
pwolanin commentedfinal patch for this issue.
fixes various settings forms and variables, avoids a notice, removes use of md5() in favor of drupal_hash_base64().
committing to CVS.