Fred Tibo
Forum Replies Created
-
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] Solr filterThanks for your answer, I didn’t know that. A little last oen for today.
My custom fields are not send to solr, only custom fields configure in wpsolr indexing options. Because I have json coming from an external system and I only need this data in solr for the search, I don’t have custom fields.
add_filter(WpSolrFilters::WPSOLR_FILTER_POST_CUSTOM_FIELDS, function ($custom_fields, $postId) { $json = get_post_meta($postId,'json'); $obj = json_decode($json, false); /* not existing fields in wpsolr indexing options */ $custom_fields['test_1_str'] = $obj->test1; $custom_fields['test_2_str'] = $obj->test2; $custom_fields['test_post_id_dt'] = $obj->date; return $custom_fields; }, 10, 2);Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] Solr filterThe apply_filters function only support 2 parameters,
function apply_filters( $tag, $value ) {that’s probably why I receive the $custom_fields but the postId is always not set.That’s the change I propose:
instead of:
$custom_fields = apply_filters( WpSolrFilters::WPSOLR_FILTER_POST_CUSTOM_FIELDS, $custom_fields, $post->ID );use
$args = ['custom-fields' => $custom_fields,'post-id' => $post->ID]; apply_filters_ref_array(WpSolrFilters::WPSOLR_FILTER_POST_CUSTOM_FIELDS, array( &$args ));and to use the filter you can do something like
add_filter(WpSolrFilters::WPSOLR_FILTER_POST_CUSTOM_FIELDS, function (&$args) { $custom_fields = $args['custom-fields']; $custom_fields['test_1'] = 'test 1 value'; $custom_fields['test_2'] = 'test 2 value'; $custom_fields['test_post_id'] = $args['post-id'];});Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] Save and Load configExporting/importing everything can be awsome and save a lot of time. It is just deciving that wordpress doesn’t store plugin config in a specific place and have the hability to export/import everything.
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] Save and Load configBecause I have to reconfigure Solr Options and Plugins Integration everytime I reset my dev environement or another dev. Because it needs some data to configure indexing options, there’s no way to have an empty environement in qa, staging and eventually prod. With a config file(json or xml) it will be possible to just edit it depending of the environment(dev,qa,staging,prod) and load it without having to import some data first.
Now I just backup all the option_value with the following keys from wp_options database table but it’s not a good way for me.
wpsolr_solr_indexes, wdm_solr_res_data, wdm_solr_form_data, wdm_solr_facet_data, wdm_solr_sortby_data, wdm_solr_extension_wpml_data, solr_docs
Thanks
Forum: Plugins
In reply to: WPML Multilingual PLUGIN not working after upgrade wordpressI have the same problem with wp 4.3.1 and sitepress-multilingual-cms 3.2.7 on nginx. The same setup works fine on Windows IIs…
I have increase wp memory to 256m with
define('WP_MEMORY_LIMIT', '256M');like I read somewhere else and it doesn’t works..