Try our conversational search powered by Generative AI!

Sort matching values first

Vote:
 

I would like to sort/boost some products to the top on my searchresult, I have a parameter on the products with budget period, yyyyx (where yyyy is budget year and x is 1 or 2 (first or second half of the year)).

So we can set a dropdown to: 0, 1, 2 and based on that value I want to sort/boost the result from find to that selected value.

I need to compare the selected valute to the last character of the property in find.

#208309
Oct 21, 2019 15:00
Vote:
 

Hi, 

If you're only interested in the X portion of the budget period, I would just create an additional property for storing the period, and index that separately as part of your product content. 

Then you can just perform an OrderBy on that specific property. 

Thanks,

Paul 

#208311
Oct 21, 2019 15:45
Vote:
 

Hi Paul,
This was exaclty what I came up with the second I was going to bed yesterday, after sitting with this issue the entire day trying to force out a solution at the sorting it came to me, as always when you stop thinking about it.

Was looking at it from the wrong direction.

Thanks

#208326
Oct 22, 2019 7:32
Vote:
 

Always the way isnt it! :D 

#208332
Oct 22, 2019 9:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.