-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Need little help how to sort products in a category by 2 fields? #2169
Comments
@TitanFighter Quite hard to tell because we can't see what your index is like ;)
doing this allows you to simply I hope this helps! |
Finally! Thanks a lot! For others want to mention, that it is necessary to update schema before index rebuilding :) |
Henk-JanVanHasselaar, the code above works just for catalogue page. Could you please give the cue, where can I apply Thank you. |
@TitanFighter That should be in view that handles your search results.. Just make sure that in your view you order the SearchQuerySet on On further questions can you please submit them in the mailing list? |
In
StockReckords
there are products, which can be provided by few partners (lets say for now Partner # 1 is our remote partner with a remore warehouse and Partner # 2 is our shop with our warehouse)At front-end I want to show just products which our warehouse has.
I tried
But Solr, at the front-end, does not sort products correctly. Solr when does ordering by
num_in_stock
takes into account not JUSTnum_in_stock
of our shop, but also takes into accountnum_in_stock
of other partners. In other words - Solr starts to show just those products, which has relation to partner # 2 (our shop), but takesnum_in_stock
from Partner # 1.For example, there is a product Intel i5-5200, Partner # 1 has 20 items, we have 0. I expect to get this product at the end of the page, but I see it at the top.
How to restict sorting by Partner # 2 (our shop) + our
num_in_stock
?Thanks a lot!
The text was updated successfully, but these errors were encountered: