-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
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:
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.
Metadata
Metadata
Assignees
Labels
No labels