Guys, have you ever faced a performance issue usin...
# suitescript
m
Guys, have you ever faced a performance issue using module 'N/search'? I added a new filter in the search and the performance went down, the field is a custom field, but I have other custom fields in the filter and only one of them is causing this issue. In the picture is the time elapsed in a search without the field in the filter and the next one with the field added Any idea how to solve it?
s
Could be the order the filters are applied. I believe, but don't know for certain, that the performance would be affected by the filter order. So if you narrow down the results as fast as possible with each added filter then it might improve. for example, if you only want to search one document type between a set of dates limit by type before date. I can't say for certain this will work but I believe it has affected search speed in SS in the past for me. If you haven't already create the same search with the same filters as a saved search and play around with it.
Also post the filter section from your code
d
Do yourself a favour and move to
N/query
s
more specifically,
SuiteQL
I hope never to look at an obtuse
N/query
imperative search construct in code ever again.
😆 1
d
Ha, true. Working with pure SQL is the way to go.
m
@Simon Whittle @darrenhillconsulting @Shawn Talbert thanks! I did what you said, moved to SuiteQL and It is working fine and with a good performance
I wrote pure SQL by the way LOL
d
Nice