Bug #425

avatar

SOLR_DOCUMENT_ID still hardcoded as "id" in a few spots

Added by Matt Zumwalt 360 days ago. Updated 336 days ago.

Status:Closed Start:08/03/2009
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:- Spent time: 0.50 hours
Target version:1.0.6
Sponsor:


Description

[Submitted to the mailing list by Willy Mene]

I'm now testing an active-fedora app that's using a solr index with
"PID" as the unique document identifier, and am running into a few
spots in the active-fedora code where it is trying to access documents
using the hardcoded string "id" instead of the SOLR_DOCUMENT_ID
constant.

In active_fedora/model.rb, in the #find method:
...
64 hits = SolrService.instance.conn.query(q).hits
65 results = hits.map do |hit|
66 obj = Fedora::Repository.instance.find_model(hit["id"], self)
67 #obj.inner_object.new_object = false
68 #return obj
69 end
...

Line 66 should be
obj = Fedora::Repository.instance.find_model(hit[SOLR_DOCUMENT_ID], self)

And in active_fedora/semantic_node.rb in the
#create_inbound_relationship_finders method:
...
156 solr_result.hits.each do |hit|
157 id_array << hit["id"]
158 end
...

Line 157 should be
d_array << hit[SOLR_DOCUMENT_ID]

History

Updated by Willy Mene 360 days ago

avatar

Here's another one. active_fedora/solr_service.rb, self#reify_solr_results, line 30 should be

results << Fedora::Repository.instance.find_model(hit[SOLR_DOCUMENT_ID], classname)

Updated by Matt Zumwalt 359 days ago

avatar
  • Status changed from New to Resolved

Updated by Matt Zumwalt 336 days ago

avatar
  • Status changed from Resolved to Closed

Also available in: Atom PDF