Indexing similar category paths moves products to other categories

  • gkandylakis
    Participant
    2 years, 4 months ago #20861

    We are getting results from other categories with similar path in the name. For example when we have products in

    ΑΝΔΡΑΣ > ΠΑΠΟΥΤΣΙΑ > ΜΟΔΑΣ

    and

    ΑΓΟΡΙ > ΠΑΠΟΥΤΣΙΑ > ΜΟΔΑΣ

    We are getting the results of the second category in the filters of the first.

    We already tried re-indexing everything twice and the problem remains.

    wpsolr
    Keymaster
    2 years, 4 months ago #20863

    This is a bug indeed. I suggest to change duplicate taxonomies and reindex.

    gkandylakis
    Participant
    2 years, 4 months ago #20866

    Changing the category tree is not an option. This wasn’t an issue in the demo we setup together. What other option is there?

    wpsolr
    Keymaster
    2 years, 4 months ago #20868

    Try to activate the Elasticsearch debug trace in screen 2.1 on both environments, to understand the difference.

    gkandylakis
    Participant
    2 years, 4 months ago #20870

    This is the log when i enter the category

    [09-Jul-2020 13:26:52 UTC] Log WPSOLR query: 21/892 results in 686 ms:
    {“from”:0,”size”:21,”_source”:[“id”,”PID”,”type”,”meta_type_s”,”title”,”numcomments”,”comments”,”displaydate”,”displaymodified”,”*categories_str”,”author”,”*post_thumbnail_href_str”,”*post_href_str”,”snippet_s”],”query”:{“bool”:{“must”:{“query_string”:{“query”:”text:(*)”,”default_operator”:”AND”}},”filter”:{“bool”:{“must”:[{“terms”:{“type”:[“product”]}},{“bool”:{“must_not”:[{“terms”:{“post_status_s”:[“draft”,”pending”,”trash”,”future”,”private”,”auto-draft”]}}]}},{“bool”:{“must”:{“term”:{“non_flat_hierarchy_product_cat_str”:”\u039c\u039f\u0394\u0391\u03a3″}}}},{“bool”:{“should”:[{“bool”:{“must_not”:[{“exists”:{“field”:”product_visibility_str”}}]}},{“bool”:{“must_not”:[{“terms”:{“product_visibility_str”:[“exclude-from-catalog”]}}]}}]}},{“bool”:{“should”:[{“bool”:{“must_not”:[{“bool”:{“must”:{“exists”:{“field”:”product_stock_str”}}}}]}},{“terms”:{“product_stock_str”:[“y”]}}]}},{“bool”:{“should”:[{“bool”:{“must_not”:[{“bool”:{“must”:{“exists”:{“field”:”is_excluded_s”}}}}]}},{“terms”:{“is_excluded_s”:[“n”]}}]}},{“bool”:{“must_not”:[{“terms”:{“_id”:[“wpsolr_doc_id_attachment”]}}]}}]}}}},”aggs”:{“flat_hierarchy_product_cat_str”:{“filter”:{“match_all”:{}},”aggs”:{“flat_hierarchy_product_cat_str”:{“terms”:{“field”:”flat_hierarchy_product_cat_str”,”size”:100}}}},”product_brand_str”:{“filter”:{“match_all”:{}},”aggs”:{“product_brand_str”:{“terms”:{“field”:”product_brand_str”,”size”:100}}}},”pa_size_str”:{“filter”:{“match_all”:{}},”aggs”:{“pa_size_str”:{“terms”:{“field”:”pa_size_str”,”size”:100}}}},”pa_color_str”:{“filter”:{“match_all”:{}},”aggs”:{“pa_color_str”:{“terms”:{“field”:”pa_color_str”,”size”:100}}}},”_price_f”:{“filter”:{“match_all”:{}},”aggs”:{“_price_f”:{“range”:{“field”:”_price_f”,”ranges”:[{“to”:”0″},{“from”:0,”to”:50},{“from”:50,”to”:100},{“from”:100,”to”:150},{“from”:”150″}]}}}}}}

    and this is when i click one of the wrong filters

    [09-Jul-2020 13:26:52 UTC] Log WPSOLR query: 21/892 results in 686 ms:
    {“from”:0,”size”:21,”_source”:[“id”,”PID”,”type”,”meta_type_s”,”title”,”numcomments”,”comments”,”displaydate”,”displaymodified”,”*categories_str”,”author”,”*post_thumbnail_href_str”,”*post_href_str”,”snippet_s”],”query”:{“bool”:{“must”:{“query_string”:{“query”:”text:(*)”,”default_operator”:”AND”}},”filter”:{“bool”:{“must”:[{“terms”:{“type”:[“product”]}},{“bool”:{“must_not”:[{“terms”:{“post_status_s”:[“draft”,”pending”,”trash”,”future”,”private”,”auto-draft”]}}]}},{“bool”:{“must”:{“term”:{“non_flat_hierarchy_product_cat_str”:”\u039c\u039f\u0394\u0391\u03a3″}}}},{“bool”:{“should”:[{“bool”:{“must_not”:[{“exists”:{“field”:”product_visibility_str”}}]}},{“bool”:{“must_not”:[{“terms”:{“product_visibility_str”:[“exclude-from-catalog”]}}]}}]}},{“bool”:{“should”:[{“bool”:{“must_not”:[{“bool”:{“must”:{“exists”:{“field”:”product_stock_str”}}}}]}},{“terms”:{“product_stock_str”:[“y”]}}]}},{“bool”:{“should”:[{“bool”:{“must_not”:[{“bool”:{“must”:{“exists”:{“field”:”is_excluded_s”}}}}]}},{“terms”:{“is_excluded_s”:[“n”]}}]}},{“bool”:{“must_not”:[{“terms”:{“_id”:[“wpsolr_doc_id_attachment”]}}]}}]}}}},”aggs”:{“flat_hierarchy_product_cat_str”:{“filter”:{“match_all”:{}},”aggs”:{“flat_hierarchy_product_cat_str”:{“terms”:{“field”:”flat_hierarchy_product_cat_str”,”size”:100}}}},”product_brand_str”:{“filter”:{“match_all”:{}},”aggs”:{“product_brand_str”:{“terms”:{“field”:”product_brand_str”,”size”:100}}}},”pa_size_str”:{“filter”:{“match_all”:{}},”aggs”:{“pa_size_str”:{“terms”:{“field”:”pa_size_str”,”size”:100}}}},”pa_color_str”:{“filter”:{“match_all”:{}},”aggs”:{“pa_color_str”:{“terms”:{“field”:”pa_color_str”,”size”:100}}}},”_price_f”:{“filter”:{“match_all”:{}},”aggs”:{“_price_f”:{“range”:{“field”:”_price_f”,”ranges”:[{“to”:”0″},{“from”:0,”to”:50},{“from”:50,”to”:100},{“from”:100,”to”:150},{“from”:”150″}]}}}}}}

    wpsolr
    Keymaster
    2 years, 4 months ago #20872

    Did you check the “Is a hierarchy” on your category in screen 2.4 (Filters)?

    gkandylakis
    Participant
    2 years, 4 months ago #20874

    I just doubled checked it. Yes “Show the hierarchy” is checked

    wpsolr
    Keymaster
    2 years, 4 months ago #20876

    How do you display your categories? (checkbox, list box ?)

    wpsolr
    Keymaster
    2 years, 4 months ago #20877

    Image wpsolr-woocommerce-product-categories-hierarchy-filter.png of

    I logged the ES query on my own env, and it’s very different:
    {“bool”:{“must”:{“term”:{“non_flat_hierarchy_product_cat_str”:”cat 1″}}}},
    {“bool”:{“must”:{“term”:{“non_flat_hierarchy_product_cat_str”:”cat 1 1″}}}},
    {“bool”:{“must”:{“term”:{“non_flat_hierarchy_product_cat_str”:”cat 1 1 1″}}}}

    The 3 categories in the parent-child hierarchy are filtered, which prevent duplicates on children with the same name.

    gkandylakis
    Participant
    2 years, 4 months ago #20883

    filter

    We display them as a hierarchy. Have you tried to make the hierarchy using latin characters for names?

    The path in our categories goes more like this

    agori

    antras

    gkandylakis
    Participant
    2 years, 4 months ago #20884
    wpsolr
    Keymaster
    2 years, 4 months ago #20888

    When you select a child category, are the parents selected automatically too?

    gkandylakis
    Participant
    2 years, 4 months ago #20890

    Yes they are.

    wpsolr
    Keymaster
    2 years, 4 months ago #20894

    What are the url parameters when you select the child?

    gkandylakis
    Participant
    2 years, 4 months ago #20896

    ?wpsolr_fq%5B0%5D=product_cat_str%3AΜΟΔΑΣ&wpsolr_fq%5B1%5D=product_cat_str%3A35.5-40(ΜΕΓ.)

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

You must be logged in to reply to this topic.