Indexing similar category paths moves products to other categories
- giannissakParticipant3 years, 9 months ago #21149
Hi Patrice
I’m John we can start talk together about the energy-sport.gr
can you inform me what you need to proceed with the debuging;wpsolrKeymaster3 years, 9 months ago #21163Hi John,
Let’s try to print out the query parameters.
Edit /wp-content/plugins/wpsolr-pro/wpsolr/core/classes/ui/class-wpsolr-query.php on line 197, and comment out
public function set_filter_query_fields( $fq ) { // Ensure fq is always an array $this->wpsolr_filter_query = empty( $fq ) ? [] : ( is_array( $fq ) ? array_unique( $fq ) : [ $fq ] ); return $this; }
and add
public function set_filter_query_fields( $fq ) { // Ensure fq is always an array $this->wpsolr_filter_query = empty( $fq ) ? [] : ( is_array( $fq ) ? array_unique( $fq ) : [ $fq ] ); echo wp_json_encode($this->wpsolr_filter_query); echo '<br>'; return $this; }
Let me know what traces you see.
- This reply was modified 3 years, 9 months ago by wpsolr.
gkandylakisParticipant3 years, 9 months ago #21165i inserted the code you asked in the site and it gave me the following on the wrong filters.
[“product_cat_str:\u039c\u03a0\u0391\u03a3\u039a\u0395\u03a4”]
on the link
I also made the version of elasticsearch the same as the one on the isneakers server just to notice that the problem is also there too. It wasn’t apparent due to the depth of the sub categories you had to go to notice it.
https://staging.isneakers.gr/product-category/eshop/man/menshoes/
https://www.energy-sport.gr/product-category/eshop/man/menshoes/
both are identical sites
the problem is not on the filtering side of things but i believe it is on the indexing. You can give us a demo elasticsearch database to send the data from your plugin so that you can investigate further.
gkandylakisParticipant3 years, 9 months ago #21168elasticsearch service had stopped. I restarted it.
Selecting a parent category and narrowing down the filters by brand or size seem to work fine without having the category problems.
this is the path when selecting brand first
https://www.energy-sport.gr/product-category/eshop/?wpsolr_fq%5B0%5D=product_cat_str%3A%CE%91%CE%9D%CE%94%CE%A1%CE%91%CE%A3&wpsolr_fq%5B1%5D=product_cat_str%3A%CE%A0%CE%91%CE%A0%CE%9F%CE%A5%CE%A4%CE%A3%CE%99%CE%91&wpsolr_fq%5B2%5D=product_cat_str%3A%CE%9C%CE%9F%CE%94%CE%91%CE%A3&wpsolr_fq%5B3%5D=product_brand_str%3ANEW%20BALANCE[“product_cat_str:\u0391\u039d\u0394\u03a1\u0391\u03a3″,”product_cat_str:\u03a0\u0391\u03a0\u039f\u03a5\u03a4\u03a3\u0399\u0391″,”product_cat_str:\u039c\u039f\u0394\u0391\u03a3″,”product_brand_str:NEW BALANCE”]
i narrowed down the problem on what i think is the source. Going directly to the category and having more than 2 sub categories the problem starts to appear
if i browse on
https://www.energy-sport.gr/product-category/eshop/man/menshoes/
the problem appears because it only reads the remaing subcategories that is
product_cat_str:\u039c\u039f\u0394\u0391\u03a3
but by clicking on the similar named category
https://www.energy-sport.gr/product-category/eshop/boy/boysshoes/
the subcategory ΜΟΔΑΣ is also there but this one has sub categories on itself but the product_cat_str is the same
product_cat_str:\u039c\u039f\u0394\u0391\u03a3
So the problem here i noticed is that categories are not being tracked by slug that is forcibly unique by the platform but by name that can be the same in all categories without any limits.
gkandylakisParticipant3 years, 9 months ago #21169The proof of concept stands true when i changed the ΜΟΔΑΣ in the other categories the problem disappeared completely
gkandylakisParticipant3 years, 9 months ago #21170The problem still is there for all the other categories that share similar names between them. Can we change something to make it use the category slug instead of category name?
gkandylakisParticipant3 years, 9 months ago #21190I already send you 3 times images of the problem. The site has on the top right corner a translator so you can pick language there. You can test it on your own by making the followin categories in a test enviroment
category 1 path
root>men>fashion>shoesand under the same root
category 2 path
root>women>fashion>shoes>runningand you navigate to the first category
root>men>fashion>shoes
you will see a category filter “running”! But that category is in another path of that category tree!
I recreated the problem to show you
go to this link
https://www.energy-sport.gr/product-category/root/men/fashion-men/shoes/
and you will see the problem i described above i put 1 product in each of the previously mentioned categories like this
https://drive.google.com/file/d/1HiqaPn91B0olkzXBjRB5FK8mXyJmYaKk/view?usp=sharing
but if you go to the link i gave you, you will see both products and the running filter in categories as you can see in this foto
https://drive.google.com/file/d/1xOlpIxdm_vI2EmE2JqX3_mjP9MC9KYL8/view?usp=sharing
You must be logged in to reply to this topic.