TomasJerrySebo
Forum Replies Created
-
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationI tried to replace it but it throws an error . It worked with my modification.
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationI tried to change the set_sql_query_statement function in the plugin-polylang.php as following and it’s working :
function set_sql_query_statement( $sql_statements, $parameters ) {
global $wpdb;// Get the index indexing language
$language = $this->get_solr_index_indexing_language( $parameters[‘index_indice’] );// Get the languages
$languages = $this->get_languages();// Retrieve the term_id used for this language code
if ( ! isset( $languages[ $language ][‘term_id’] ) ) {
throw new ErrorException( sprintf( “The language ‘%s’ is undefined in %s (not in the taxonomy terms).”, $language, static::_PLUGIN_NAME_IN_MESSAGES ) );
}$language_term_id = $languages[ $language ][‘term_id’];
$term = get_term($language_term_id,’language’);
$term_taxonomy_id = $term->term_taxonomy_id;if ( isset( $language ) ) {
// Join statement
$sql_joint_statement = ‘ JOIN ‘;
$sql_joint_statement .= $wpdb->prefix . self::TABLE_TERM_RELATION_SHIPS . ‘ AS ‘ . ‘wp_term_relationships’;
$sql_joint_statement .= ” ON posts.ID = wp_term_relationships.object_id AND wp_term_relationships.term_taxonomy_id = ‘%s’ “;$sql_statements[‘JOIN’] = sprintf( $sql_joint_statement, $term_taxonomy_id );
}return $sql_statements;
}I want to ask you . Could you check it please … Thank you It’s working for me.
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationterm_taxonomy_id term_id taxonomy count
5581 5051 language a:2:{s:6:”locale”;s:5:”en_US”;s:3:”rtl”;s:1:”0″;} 3916Here is a better version
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationok so I got the problem my wp_term_relationships.term_taxonomy_id isn’t 5051 but 5581 … look …
5581 5051language a:2:{s:6:”locale”;s:5:”en_US”;s:3:”rtl”;s:1:”0″;}
5051 is the term_id
5581 is the term_taxonomy_id
How can we fix this ?
Thanks
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationHey,
so I updated the polylang plugin just like we said. In fact I updated all the plugins we have and the wpsolr still finds only 1 document to index if polylang integrations is turned on. I turned on also the debug and this is the sql query which is run :SELECT ID, post_modified, post_parent, post_type FROM wp_posts AS posts JOIN wp_term_relationships AS wp_term_relationships ON posts.ID = wp_term_relationships.object_id AND wp_term_relationships.term_taxonomy_id = ‘5051’ WHERE ( ( post_status=’publish’ AND ( post_type in (‘post’,’page’,’polylang_mo’,’post_paper’,’post_video’,’post_podcast’,’post_infographic’,’post_htmlpapers’) ) ) OR ( ( post_status=’publish’ OR post_status=’inherit’ ) AND post_type=’attachment’ AND post_mime_type in (‘application/pdf’) ) ) ORDER BY post_modified ASC
with polylang integration turned on and this is the one without it :
SELECT ID, post_modified, post_parent, post_type FROM wp_posts AS posts WHERE ( ( post_status=’publish’ AND ( post_type in (‘post’,’page’,’polylang_mo’,’post_paper’,’post_video’,’post_podcast’,’post_infographic’,’post_htmlpapers’) ) ) OR ( ( post_status=’publish’ OR post_status=’inherit’ ) AND post_type=’attachment’ AND post_mime_type in (‘application/pdf’) ) ) ORDER BY post_modified ASC
The first returns only one post the second one returns 7800 posts. I checked and it must be something with that wp_term_relationships.term_taxonomy_id = ‘5051’ because that limits it to one post. Is that some kind of language ID in polylang which should define which posts to choose based on that ID ?
Thank you
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationYea will do that. Thanks for the advice
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationalready on the chat now
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationOk I tried everything. It always says it indexed only 1 document. When I’m using the polylang integration. We have three languages and it indexes 1 document for each language. As if the query would find only one result to index.
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationOK. I will try it one more time anew completly removing all of them.
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationHey,
sorry I was out for two weeks. I just tested the functionality. Somehow when I activate the polylang integration and start the indexing, then each of the languages index only 1 document and then it stops. Altought in total we have over 9000. When the polylang integration is disabled it works just fine. Any ideas ? Do I have to change anything in the polylang settings ?Thanks
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationThe solution is included in the last update right ?
ThanksForum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationI didn’t ran into this up until now so I didn’t know. But unfortunatelly it seems the case read here :
Thanks
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationAs for the polylang functions, ehm … usually defined the global polylang and called the functions :
global $polylang;
$languages_list = $polylang->get_languages_list()thanks
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationIn table wp_term_taxonomy with taxonomy=language is stored information about every language, added with plugin polylang.
And in table wp_term_relationships object_id is your post/page id from table wp_posts and term_taxonomy_id is id of your language.
So if you want to get all posts for defined language, you can do it with query:
SELECT p.* FROM wp_posts p INNER JOIN wp_term_relationships r ON r.object_id=p.ID WHERE r.term_taxonomy_id=language_id
where language_id is id of language you needed.
Forum: Plugins
In reply to: [WPSOLR - Elasticsearch and Solr search] SOLR and POLYLANG integrationThat would be fantastic. Yea I will take a look if I notice something I will let you know. Many thanks