| |
140 |
140 |
|
| |
141 |
141 |
if {[callback::impl_exists -callback search::index -impl $driver]} { |
| |
142 |
142 |
if {![info exists datasource(package_id)]} { |
| |
143 |
143 |
set datasource(package_id) "" |
| |
144 |
144 |
} |
| |
145 |
145 |
# set datasource(community_id) [search::dotlrn::get_community_id -package_id $datasource(package_id)] |
| |
146 |
146 |
|
| |
147 |
147 |
if {![info exists datasource(relevant_date)]} { |
| |
148 |
148 |
set datasource(relevant_date) "" |
| |
149 |
149 |
} |
| |
150 |
150 |
callback -impl $driver search::index -object_id $object_id -content $txt -title $datasource(title) -keywords $datasource(keywords) -package_id $datasource(package_id) -community_id $datasource(community_id) -relevant_date $datasource(relevant_date) -datasource datasource |
| |
151 |
151 |
} else { |
| |
152 |
152 |
acs_sc_call FtsEngineDriver \ |
| |
153 |
153 |
[ad_decode $event UPDATE update_index index] \ |
| |
154 |
154 |
[list $datasource(object_id) $txt $datasource(title) $datasource(keywords)] $driver |
| |
155 |
155 |
} |
| |
156 |
156 |
} errMsg]} { |
| |
157 |
157 |
ns_log Error "search::indexer: error getting datasource for $object_id $object_type: $errMsg\n[ad_print_stack_trace]\n" |
| |
158 |
158 |
} else { |
| |
159 |
159 |
# call the action so other people who do indexey things have a hook |
| |
160 |
|
# callback -catch search::action \ |
| |
|
160 |
callback -catch search::action \ |
| |
161 |
161 |
-action $event \ |
| |
162 |
162 |
-object_id $object_id \ |
| |
163 |
163 |
-datasource datasource \ |
| |
164 |
164 |
-object_type $object_type |
| |
165 |
165 |
|
| |
166 |
166 |
# Remember seeing this object so we can avoid reindexing it later |
| |
167 |
167 |
set seen($object_id) 1 |
| |
168 |
168 |
|
| |
169 |
169 |
search::dequeue -object_id $object_id -event_date $event_date -event $event |
| |
170 |
170 |
} |
| |
171 |
171 |
} |
| |
172 |
172 |
} |
| |
173 |
173 |
} |
| |
174 |
174 |
DELETE { |
| |
175 |
175 |
if {[catch { |
| |
176 |
176 |
acs_sc_call FtsEngineDriver unindex [list $object_id] $driver |
| |
177 |
177 |
} errMsg]} { |
| |
178 |
178 |
ns_log Error "search::indexer: error unindexing $object_id $object_type: $errMsg\n[ad_print_stack_trace]\n" |
| |
179 |
179 |
} else { |
| |
180 |
180 |
# call the search action callbacks. |