cannot build index

  • kuangli0409
    Participant
    4 years ago #18676

    hi,

    I tried to set up WPSolr with Woocommerce/Algolia (which I used for a very long time). However, I cannot build index. When I click “index selected post type”, then

    An error or timeout occured.

    Error code: error

    Error message: Internal Server Error

    {“nb_results”:0,”status”:1,”message”:”Error on line 7 of file \/data\/wwwroot\/default\/wordpress\/wp-content\/plugins\/code-snippets\/php\/snippet-ops.php(446) : eval()’d code: Cannot redeclare get_the_term_list_public() (previously declared in \/data\/wwwroot\/default\/wordpress\/wp-content\/plugins\/code-snippets\/php\/snippet-ops.php(446) : eval()’d code:7)”,”indexing_complete”:false}

    I tried to turn of the snippet plugin, but things become worse. A lot of parse error message. Can you help me to solve the problem?

    Thx

    wpsolr
    Keymaster
    4 years ago #18677

    Do you know what is your PHP version?

    wpsolr
    Keymaster
    4 years ago #18678

    The error seems to indicate that a code snippet should test existence of function ‘get_the_term_list_public’ before declaring it:
    https://www.php.net/manual/en/function.function-exists.php

    kuangli0409
    Participant
    4 years ago #18679

    well. In fact I don’t know how to solve it. Snippet is a very common plugin. And even if I disable it, there are so many paring error so I cannot built any index. And idea?

    wpsolr
    Keymaster
    4 years ago #18680

    Deactivate the snippet plugin, and let me know what errors you have.

    Also, do you have errors without WPSOLR?

    kuangli0409
    Participant
    4 years ago #18681

    php version is: 7.3.12

    If I disable snippet, then it shows

    An error or timeout occured.

    Error code: parsererror

    Error message: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    (removed)

    ===========================
    something like this for thousand lines.

    • This reply was modified 4 years ago by wpsolr.
    wpsolr
    Keymaster
    4 years ago #18683

    Can you index with batch size “1”?

    Indexing will stop at first error. Then start again (keep batch size “1”). You should then see a better error message with the post id in error.

    kuangli0409
    Participant
    4 years ago #18684

    The error message is as follows. (however, the snippet is enable, but doesn’t show any error message about snippet)

    An error or timeout occured.

    Error code: parsererror

    Error message: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    Posts excluded from the index:<br><b>184073</b><br><br>******** DEBUG ACTIVATED – Beginning of new loop (batch size) *******<br><br>******** DEBUG ACTIVATED – Query documents from last post date *******<br><br>Query:<br><b>SELECT ID, post_modified, post_parent, post_type FROM wpyuepu_posts AS A WHERE ((post_modified = ‘2020-03-14 17:34:50’ AND ID > 176687) OR (post_modified > ‘2020-03-14 17:34:50’)) AND ( post_status IN (‘publish’) AND ( post_type = ‘product’ ) ) AND ID NOT IN (184073) ORDER BY post_modified ASC, ID ASC LIMIT 1</b><br><br>Last post date:<br><b>2020-03-14 17:34:50</b><br><br>Last post ID:<br><b>176687</b><br><br>Post to be sent:<br><b>{ “id”: 109242, “PID”: 109242, “type”: “product”, “meta_type_s”: “post_type”, “displaymodified”: “2020-03-14T17:35:14Z”, “title”: “\u97e9\u71d5\u73b2: \u9ad8\u8003\u97f3\u4e50\u5f3a\u5316\u8bad\u7ec3 \u8282\u594f\u8bad\u7ec3\u4e0e\u65cb\u5f8b\u542c\u5199\uff08\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e\uff09”, “title_s”: “\u97e9\u71d5\u73b2: \u9ad8\u8003\u97f3\u4e50\u5f3a\u5316\u8bad\u7ec3 \u8282\u594f\u8bad\u7ec3\u4e0e\u65cb\u5f8b\u542c\u5199\uff08\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e\uff09”, “permalink”: “https:\/\/buy.laimaipu.com\/product\/%e6%b9%96%e5%8d%97%e6%96%87%e8%89%ba%e5%87%ba%e7%89%88%e7%a4%be-%e9%ab%98%e8%80%83%e9%9f%b3%e4%b9%90%e5%bc%ba%e5%8c%96%e8%ae%ad%e7%bb%83-%e8%8a%82%e5%a5%8f%e8%ae%ad%e7%bb%83%e4%b8%8e%e6%97%8b\/”, “post_status_s”: “publish”, “content”: “\u559c\u6b22\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e\u7684\u9ad8\u8003\u7cfb\u5217\u4e1b\u4e66\u7684\u8001\u5e08\uff0c\u8fd9\u672c\u8282\u594f\u8bad\u7ec3\u4e0e\u65cb\u5f8b\u542c\u5199\u4e5f\u662f\u5f88\u503c\u5f97\u53c2\u8003\u7684\u3002 simple. \u975e\u8fdb\u53e3\u4e66\u85c9. \u4e00\u822c85. \u542c\u529b\u8bad\u7ec3. \u8282\u594f\u8bad\u7ec3. \u97e9\u71d5\u73b2. \u9ad8\u6821\u6559\u6750. \u534a\u4e13\u4e1a\u4eba\u58eb. \u4e13\u4e1a\u4e66\u85c9. \u4e2d\u6587\ufe63\u539f\u8457. 153. \u6e56\u5357\u6587\u827a\u51fa\u7248\u793e”, “snippet_s”: “\u559c\u6b22\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e\u7684\u9ad8\u8003\u7cfb\u5217\u4e1b\u4e66\u7684\u8001\u5e08\uff0c\u8fd9\u672c\u8282\u594f\u8bad\u7ec3\u4e0e\u65cb\u5f8b\u542c\u5199\u4e5f\u662f?”, “post_author_s”: “2”, “author”: “thinkmusic”, “menu_order_i”: 0, “PID_i”: 109242, “author_s”: “https:\/\/buy.laimaipu.com\/author\/thinkmusic\/”, “displaydate”: “2019-01-11T19:58:32Z”, “displaydate_dt”: “2019-01-11T19:58:32Z”, “date”: “2019-01-11T11:58:32Z”, “displaymodified_dt”: “2020-03-14T17:35:14Z”, “modified”: “2020-03-14T09:35:14Z”, “displaymodified_dt_i”: 1584207314, “displaymodified_dt_y_i”: 2020, “displaymodified_dt_ym_i”: 3, “displaymodified_dt_yw_i”: 11, “displaymodified_dt_yd_i”: 74, “displaymodified_dt_md_i”: 14, “displaymodified_dt_wd_i”: 7, “displaymodified_dt_dh_i”: 17, “displaymodified_dt_dm_i”: 35, “displaymodified_dt_ds_i”: 14, “displaydate_dt_i”: 1547236712, “displaydate_dt_y_i”: 2019, “displaydate_dt_ym_i”: 1, “displaydate_dt_yw_i”: 2, “displaydate_dt_yd_i”: 11, “displaydate_dt_md_i”: 11, “displaydate_dt_wd_i”: 6, “displaydate_dt_dh_i”: 19, “displaydate_dt_dm_i”: 58, “displaydate_dt_ds_i”: 32, “date_i”: 1547207912, “date_y_i”: 2019, “date_ym_i”: 1, “date_yw_i”: 2, “date_yd_i”: 11, “date_md_i”: 11, “date_wd_i”: 6, “date_dh_i”: 11, “date_dm_i”: 58, “date_ds_i”: 32, “displaydate_i”: 1547236712, “displaydate_y_i”: 2019, “displaydate_ym_i”: 1, “displaydate_yw_i”: 2, “displaydate_yd_i”: 11, “displaydate_md_i”: 11, “displaydate_wd_i”: 6, “displaydate_dh_i”: 19, “displaydate_dm_i”: 58, “displaydate_ds_i”: 32, “modified_i”: 1584178514, “modified_y_i”: 2020, “modified_ym_i”: 3, “modified_yw_i”: 11, “modified_yd_i”: 74, “modified_md_i”: 14, “modified_wd_i”: 7, “modified_dh_i”: 9, “modified_dm_i”: 35, “modified_ds_i”: 14, “comments”: [], “numcomments”: 0, “categories_str”: [], “categories_t”: [], “flat_hierarchy_categories_str”: [], “non_flat_hierarchy_categories_str”: [], “tags”: [], “tags_t”: [], “product_type_str”: [ “simple” ], “product_type_t”: [ “simple” ], “flat_hierarchy_product_type_str”: [ “simple” ], “non_flat_hierarchy_product_type_str”: [ “simple” ], “product_cat_str”: [ “\u975e\u8fdb\u53e3\u4e66\u85c9” ], “product_cat_t”: [ “\u975e\u8fdb\u53e3\u4e66\u85c9” ], “flat_hierarchy_product_cat_str”: [ “\u4e50\u8c31\u6216\u4e66\u85c9->\u975e\u8fdb\u53e3\u4e66\u85c9” ], “non_flat_hierarchy_product_cat_str”: [ “\u4e50\u8c31\u6216\u4e66\u85c9”, “\u975e\u8fdb\u53e3\u4e66\u85c9” ], “product_tag_str”: [ “\u4e00\u822c85” ], “product_tag_t”: [ “\u4e00\u822c85” ], “flat_hierarchy_product_tag_str”: [ “\u4e00\u822c85” ], “non_flat_hierarchy_product_tag_str”: [ “\u4e00\u822c85” ], “pa_booktype_str”: [ “\u542c\u529b\u8bad\u7ec3”, “\u8282\u594f\u8bad\u7ec3” ], “pa_booktype_t”: [ “\u542c\u529b\u8bad\u7ec3”, “\u8282\u594f\u8bad\u7ec3” ], “flat_hierarchy_pa_booktype_str”: [ “\u542c\u529b\u8bad\u7ec3”, “\u8282\u594f\u8bad\u7ec3” ], “non_flat_hierarchy_pa_booktype_str”: [ “\u542c\u529b\u8bad\u7ec3”, “\u8282\u594f\u8bad\u7ec3” ], “pa_composer_str”: [ “\u97e9\u71d5\u73b2” ], “pa_composer_t”: [ “\u97e9\u71d5\u73b2” ], “flat_hierarchy_pa_composer_str”: [ “\u97e9\u71d5\u73b2” ], “non_flat_hierarchy_pa_composer_str”: [ “\u97e9\u71d5\u73b2” ], “pa_exam_str”: [ “\u9ad8\u6821\u6559\u6750” ], “pa_exam_t”: [ “\u9ad8\u6821\u6559\u6750” ], “flat_hierarchy_pa_exam_str”: [ “\u9ad8\u6821\u6559\u6750” ], “non_flat_hierarchy_pa_exam_str”: [ “\u9ad8\u6821\u6559\u6750” ], “pa_group_str”: [ “\u534a\u4e13\u4e1a\u4eba\u58eb”, “\u4e13\u4e1a\u4e66\u85c9” ], “flat_hierarchy_pa_group_str”: [ “\u534a\u4e13\u4e1a\u4eba\u58eb”, “\u4e13\u4e1a\u4e66\u85c9” ], “non_flat_hierarchy_pa_group_str”: [ “\u534a\u4e13\u4e1a\u4eba\u58eb”, “\u4e13\u4e1a\u4e66\u85c9” ], “pa_language_str”: [ “\u4e2d\u6587\ufe63\u539f\u8457” ], “pa_language_t”: [ “\u4e2d\u6587\ufe63\u539f\u8457” ], “flat_hierarchy_pa_language_str”: [ “\u4e2d\u6587\ufe63\u539f\u8457” ], “non_flat_hierarchy_pa_language_str”: [ “\u4e2d\u6587\ufe63\u539f\u8457” ], “pa_pager_str”: [ “153” ], “flat_hierarchy_pa_pager_str”: [ “153” ], “non_flat_hierarchy_pa_pager_str”: [ “153” ], “pa_press_str”: [ “\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e” ], “pa_press_t”: [ “\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e” ], “flat_hierarchy_pa_press_str”: [ “\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e” ], “non_flat_hierarchy_pa_press_str”: [ “\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e” ], “categories”: [ “simple”, “\u975e\u8fdb\u53e3\u4e66\u85c9”, “\u4e00\u822c85”, “\u542c\u529b\u8bad\u7ec3”, “\u8282\u594f\u8bad\u7ec3”, “\u97e9\u71d5\u73b2”, “\u9ad8\u6821\u6559\u6750”, “\u534a\u4e13\u4e1a\u4eba\u58eb”, “\u4e13\u4e1a\u4e66\u85c9”, “\u4e2d\u6587\ufe63\u539f\u8457”, “153”, “\u6e56\u5357\u6587\u827a\u51fa\u7248\u793e” ], “_global_tab_183481_content_str”: [] }</b><br><br>{“nb_results”:0,”status”:0,”message”:”(Algolia) "json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded"\n”,”indexing_complete”:false}

    wpsolr
    Keymaster
    4 years ago #18685

    Algolia detected Malformed UTF-8 characters.

    a) You can edit this post with id 184073, and prevent it from being indexed (“Do no search” check-box in the WPSOLR post metas). Then restart the indexing. Perhaps only this post is faulty.

    b) You can also check the logs in your Algolia dashboard, where you should get the same error. But then you can ask the Algolia support for more informations about the exact nature of the encoding problem.

    kuangli0409
    Participant
    4 years ago #18686

    This is what WPSolr-search created.

    https://buy.laimaipu.com/search-wpsolr/

    I check algolia, there are no record, no logs, no operation changed.

    wpsolr
    Keymaster
    4 years ago #18687

    I noticed you already have Algolia running on your site. What do you expect from WPSOLR vs what you already have?

    kuangli0409
    Participant
    4 years ago #18688

    I use Algolia’s plugin. However, it is limited, which can not search for tabs (my major requirement). And it has very limited options. So that is why I wanna use WPSolr+Algolia. (I need very strong synonym search engine, this is the major reason why I need Algolia. But there are very few Algolia-related plugins for wordpress.

    wpsolr
    Keymaster
    4 years ago #18690

    For your indexing issue, you can ask Algolia’s support to check your last batch index logs. The indexed data is logged at Algolia, just ask them why you get the UTF-8 encoding error.

    You can also try to index with the test Elasticsearch index instead of Algolia.

    kuangli0409
    Participant
    4 years ago #18691

    OK. Now, I restrict my search item (product only, nothing else), it seems it works now. But when sending index to Algolia, it seems it is easily to exceed quota (even though I set document to 1).

    (Algolia) “Record at the position 0 objectID=378 is too big size=16881 bytes. Contact us if you need an extended quota”

    Is it possible for me to send part of information (such as title and contents only), when success, then add custom field then click index? Does it work to those indexes already existed in Algolia?

    Thx

    kuangli0409
    Participant
    4 years ago #18692

    OK. Now I found that, the exceeding quota is not caused by products, or contents, but is caused by search page which WPSolr generated.

    184073 is my search page generated by WPSolr. Is it possible not sending this page to Algolia?

    ———

    Error code: parsererror

    Error message: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    {“nb_results”:0,”status”:0,”message”:”(Algolia) “Record at the position 0 objectID=378 is too big size=16647 bytes. Contact us if you need an extended quota”\n”,”indexing_complete”:false}

Viewing 15 posts - 1 through 15 (of 27 total)

You must be logged in to reply to this topic.