I'm needing to run a search where I can assign a s...
# suitescript
d
I'm needing to run a search where I can assign a score value to each result so I can then grab the results with the highest score. What is the best way to add in a value to each search result?
p
Use a formula with a
case
statement that scores based on whatever criteria
d
Let's say the formula is too large for that. So I am using the script to determine a score using an algorithm but I need to append a score value to each result I return. I don't have much experience working with searches within SuiteScript so I don't know the best method to do that from within a script.
s
Build your own object as you loop the search results, and add the data you want from the search as well as your information from your algo
d
Ah! Thank you