-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prices are not being indexed and sorting by price is not working #1322
Comments
I had the same issue. Might be solved with this one: #1313 - you should give it a try. |
@abbatis Thanks, but I'm not exactly sure what does this fix or how should I use this method. I have spent some more time and learned today that if reindexing doesn't finish properly the elasticsearch index is not actually updated. Now if I use "catalog_product_index_price_idx" instead of "catalog_product_index_price" the sorting is working but on a DESC sort direction its broken because some of the products seems to still be missing price in the elasticsearch index. Does anybody know how can I get the "catalog_product_index_price" to be populated? |
Hello @Mathiu, Considering the name of your index ( Regards |
Its migration from M1 to M2. I think I have already found the reason why its not working. I will make a pull request with description in a bit. |
@Mathiu The issue that I was experiencing is that the initial sort attribute had priority over any attribute that I would add later on. By resetting the |
@abbatis You might try out #1326, run |
@Mathiu Cool, did that work for you? Will test it right now. |
@abbatis Yes, its working for me. |
@Mathiu Your PR doesn't solve this issue for me. It seems that these XML definitions are already present in Magento core (v2.2.7). I found out that my issue relates to uppercase sort direction. So using |
@abbatis I'm glad you fixed your issue! Could you mind sharing what Magento version are you running and is it a migration from M1 to M2? The XML definitions I added are in core since 2.2.6 but they don't apply for adminhtml scope when running |
@Mathiu In my case it's an update from v2.1.12 to v2.2.7. Good luck! |
Hello @Mathiu, Could you provide use with additional details about your configuration ? Regards, |
I'm happy to provide anything I can here. There are currently 2 stores in the database right now but only one contains products. I think this is because of migration from M1, one is a default store (left over from the Magento setup) and another is migrated store created during the migration process. Other than that its a single store with only a single domain. There are ~25k configurable and simple products. All simple products are set as "Not visible individually" and configurable products are visible in search and catalog. Please let me know if you need anything else. Thanks again! |
Hello @Mathiu, Could you provide us with the result of the following SQL query ? Edit: in both context
Regards, |
Hi @rbayet I get same result when no crons are running and after a full reindex (with
The reason why prices are not indexed in elasticsearch for me is that Magento is using "catalog_product_index_price" table (which is empty) instead of "catalog_product_index_price_ws2" which contains all the data. |
Hello @Mathiu Thanks for your answer. It seems, you are indeed using some index segmentation (which the price table Now, can you look into your code base (including vendor, of course) and search in XML config files
From what you're telling me, and according to
If that's not the case, I'll have to dig deeper into the "mode switcher" and its usage. Long story short you may have pinpointed a blank spot of the module which would not be 100% due to the migration. Regards, |
Actually, running
Could you confirm @Mathiu ? If so, it means you could probably dispense of the DI introduced plugins with a simple
Indeed :
Regards, |
@rbayet Wow, spot on! It indeed says:
I guess it is kind of my bad in the end, because I remember after updating to 2.2.6 I was trying to configure indexers to use parallel mode and probably set it by accident not knowing what it does. Anyway, looking forward for the fix, as I assume it still a case where prices should be indexed, regardless of this mode. Thanks again! Edit: I didn't check it if it actually indexing prices after changing this mode, but I will be able to do that this evening. |
@rbayet Just wanted to confirm that changing the dimensions mode to none fixes sorting issue without any changes in any module. |
Thanks for the feedback @Mathiu ! |
…mentation Fixes #1322 support price index segmentation 2.6.x
…mentation-2.7.x Fixes #1322 Support price index dimensions/segmentation 2.7.x
Fixed by associated PR, will be part of next minor releases 2.6.7 & 2.7.5 |
Thank you so much @romainruaud @rbayet! |
Hi,
I have a problem where sorting products inside category by price is not working at all. I have dig a little and can see that prices are not being indexed in elasticsearch which I think is related because as far as I digged into the code sorting is done inside the query to elasticsearch.
Here is what I get when I request: http://localhost:9200/magento2_default_migrated_catalog_product_20190221_070838/product/_search?pretty&q=entity_id:101722
As you can see there is no price indexed at all. I have dig into the code and found out that the prices are retrieved based on the "catalog_product_index_price" table from database, but in my case this table is empty and I'm not sure why or when this table is being populated.
I spotted that I have a "catalog_product_index_price_idx" table filled with ~160k records which is exactly the same in terms of structure and if I change the code from "catalog_product_index_price" to: "catalog_product_index_price_idx" and run re-indexing, prices will show up in the index but sorting by price is still not working. I have even tried changing theme to luma which didn't help either.
My store contains thousands of configurable and simple products which I'm not sure if might be related to this issue.
Magento Version : 2.2.6 CE
ElasticSuite Version : 2.6.4, 2.6.6
Environment : developer & production
Third party modules : I have tried disabling all related modules and it didn't help.
Any idea why my "catalog_product_index_price" table might be empty?
I'm really thankful for this module and would appreciate any help here.
The text was updated successfully, but these errors were encountered: