Smile-SA / smile-magento-elasticsearch

Magento ElasticSearch Implementation
151 stars 90 forks source link

Sorting Product collection by attribute value #131

Open pravalitera opened 6 years ago

pravalitera commented 6 years ago

I'm trying to order my products by specific attribute value. I mean for example, i always want my blue shoes before the red ones.

I looked into FullText/Collection.php , and found the $sortOrder you talk about in your documentation

It's written : $sortOrders = ['entity_id' => 'asc'];

Maybe i don't understand, but it seems it's more: $sortOrders = ['entity_id' =>[direction=> 'asc']];

Am i right ? But i still don't understand how to sort my collection... with _option_textcolor, but what to put in it ?