title: MarkLogic : Design question on search.search Vs CTS APIs
body: <p>MarkLogic version 9.0-6</p>
  
  <p>Our team creates a bunch of custom REST APIs (v1/resources/...) and expose them as enterprise services to other stakeholders, who do not need to know anything about MarkLogic. However, our team is responsible for creating, enhancing and maintaining the server-side scripting (we use JavaScript) within MarkLogic.</p>
  
  <p>While creating custom REST APIs, our current design is to use search.search API to meet any search requirements. Lately, I am inclining more towards using the more flexible and faster CTS functions as I do not see any specific advantages of using search.search wrapper API. As my team's job is primarily to code and maintain server side scripts, I think its better to use the low level APIs (CTS functions) that offer greater flexibility and speed, than investing time on making the high level APIs (search.search or jsearch) work, or even worse, re-code to CTS functions later in the future because a specific complex functionality cannot be achieved through high level APIs.</p>
  
  <p>Design gurus, please suggest!</p>