You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call search_raw and it passes models as false to the indextank_search function, models gets set to a true value (empty array), and the raw never executes:
models = []
res = it.search("__any:(#{query.to_s}) __type:#{self.name}", options)
if models # <---- I am always true!
res['results'].each do |doc|
type, docid = doc['docid'].split(" ", 2)
models << self.find(id=docid)
end
return models
else
res['results'].each do |doc|
type, docid = doc['docid'].split(" ", 2)
doc['model'] = self.find(id=docid)
end
return res
end
I've patched my local copy thusly, and now can access the raw results.
res = it.search("__any:(#{query.to_s}) __type:#{self.name}", options)
if models
models = [] # <--- assign me after checking!
res['results'].each do |doc|
type, docid = doc['docid'].split(" ", 2)
models << self.find(id=docid)
end
return models
else
res['results'].each do |doc|
type, docid = doc['docid'].split(" ", 2)
doc['model'] = self.find(id=docid)
end
return res
end
With this change it seems to work both ways now.
The text was updated successfully, but these errors were encountered:
@rankindaveyg I've patched this error in my fork of thinkingtank and added a few minor fixes. You may want to get it: https://github.com/marcusg/thinkingtank
In addition I sent a pull request, but i'm not sure if the project is still maintained...
Hi-
If you call search_raw and it passes models as false to the indextank_search function, models gets set to a true value (empty array), and the raw never executes:
I've patched my local copy thusly, and now can access the raw results.
With this change it seems to work both ways now.
The text was updated successfully, but these errors were encountered: