Changeset 1056834
- Timestamp:
- 12/30/2014 11:33:48 AM (11 years ago)
- Location:
- opensearchserver-search/trunk
- Files:
-
- 3 edited
-
index.php (modified) (2 diffs)
-
opensearchserver_admin.php (modified) (11 diffs)
-
opensearchserver_search_functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
opensearchserver-search/trunk/index.php
r1045670 r1056834 152 152 delete_option('oss_index_from'); 153 153 delete_option('oss_index_to'); 154 delete_option('oss_custom_field');155 154 delete_option('oss_enable_translation_wpml'); 156 155 delete_option('oss_advanced_query_settings_not_automatic'); … … 166 165 delete_option($check_taxonomy_name); 167 166 } 167 $custom_field_lables = opensearchserver_get_all_custom_fields(); 168 foreach($custom_field_lables as $custom_field_label => $key) { 169 $check_custom_field_label = 'oss_custom_field_'.strtolower(str_replace(' ', '_', $custom_field_label)); 170 delete_option($check_custom_field_label); 171 } 168 172 } 169 173 -
opensearchserver-search/trunk/opensearchserver_admin.php
r1056819 r1056834 29 29 function opensearchserver_create_index() { 30 30 $indexName = get_option('oss_indexname'); 31 $custom_fields = get_option('oss_custom_field');32 31 $oss_api = opensearchserver_getapi_instance(); 33 32 $index_list = $oss_api->indexList(); … … 38 37 39 38 $oss_api->createIndex($indexName); 40 opensearchserver_create_schema( $custom_fields);41 opensearchserver_query_template( $custom_fields);39 opensearchserver_create_schema(); 40 opensearchserver_query_template(); 42 41 opensearchserver_spellcheck_query_template(); 43 42 $autocompletion = opensearchserver_getautocomplete_instance(); … … 60 59 */ 61 60 62 function opensearchserver_create_schema( $custom_fields) {61 function opensearchserver_create_schema() { 63 62 $schema = opensearchserver_getschema_instance(); 64 63 $schema_xml = $schema->getSchema(); … … 133 132 * Function to update the query template 134 133 */ 135 function opensearchserver_query_template( $custom_fields) {134 function opensearchserver_query_template() { 136 135 $query_template = opensearchserver_getsearchtemplate_instance(); 137 136 $oss_query = stripcslashes(get_option('oss_query')); … … 171 170 } 172 171 } 173 if (isset($custom_fields) && $custom_fields != null) {174 $custom_fields_array = explode(',', $custom_fields);175 foreach ($custom_fields_array as $field) {176 $field = opensearchserver_clean_field($field);177 if (strlen($field) > 0) {178 $query_template->setReturnField('search','custom_'.$field);179 }180 }181 }182 172 } 183 173 … … 246 236 $oss_login = get_option('oss_login'); 247 237 $oss_key = get_option('oss_key'); 248 $custom_fields = get_option('oss_custom_field');249 238 $lang = get_option('oss_language', ''); 250 239 $table_name_posts =$wpdb->prefix ."posts"; … … 258 247 opensearchserver_delete_document($delete); 259 248 $index = new OSSIndexDocument(); 260 opensearchserver_add_documents_to_index($index, $lang, get_post($id) , $custom_fields);249 opensearchserver_add_documents_to_index($index, $lang, get_post($id)); 261 250 opensearchserver_checkindex($index); 262 251 } else { … … 280 269 for ($i = 0; $i < $total_count; $i++) { 281 270 $post = get_post($posts[$i]->ID); 282 opensearchserver_add_documents_to_index($index, $lang, $post , $custom_fields);271 opensearchserver_add_documents_to_index($index, $lang, $post); 283 272 $index = opensearchserver_checkindex($index, 200, $i, $total_count); 284 273 } … … 374 363 } 375 364 376 function opensearchserver_add_documents_to_index(OSSIndexDocument $index, $lang, $post , $customFields) {365 function opensearchserver_add_documents_to_index(OSSIndexDocument $index, $lang, $post) { 377 366 $user = opensearchserver_get_user_cache($post->post_author); 378 367 $content = $post->post_content; … … 490 479 * action "oss_index_document" 491 480 */ 492 do_action('oss_index_document', $document, $index, $lang, $post , $customFields);481 do_action('oss_index_document', $document, $index, $lang, $post); 493 482 494 483 //free memory … … 737 726 $oss_filter_language_field_wpml = isset($_POST['oss_filter_language_field_wpml']) ? $_POST['oss_filter_language_field_wpml'] : NULL; 738 727 update_option('oss_filter_language_field_wpml', $oss_filter_language_field_wpml); 739 740 //some options needs to post changes to OSS 741 if(!opensearchserver_is_query_settings_not_automatic() || (isset($_POST['oss_query_settings_post_to_oss']) && $_POST['oss_query_settings_post_to_oss'] == 1)) { 742 $custom_fields = get_option('oss_custom_field'); 743 opensearchserver_query_template($custom_fields); 744 } 745 728 //some options needs to post changes to OSS 729 if(!opensearchserver_is_query_settings_not_automatic() || (isset($_POST['oss_query_settings_post_to_oss']) && $_POST['oss_query_settings_post_to_oss'] == 1)) { 730 opensearchserver_query_template(); 731 } 746 732 opensearchserver_display_messages('OpenSearchServer Query Settings have been updated.'); 747 733 } -
opensearchserver-search/trunk/opensearchserver_search_functions.php
r1021525 r1056834 368 368 } 369 369 370 function opensearchserver_get_custom_fields() {371 return explode(",",get_option('oss_custom_field'));372 }373 370 374 371 /**
Note: See TracChangeset
for help on using the changeset viewer.