search:search() vs cts:search() in MarkLogic

主宰稳场 提交于 2019-12-04 09:16:38

Also worth mentioning are the:

  • Client REST API, which basically exposes the Search API as an HTTP interface
  • Java Client API, which exposes the Client REST API as a set of convenient Java objects, and methods
  • Node.js Client API, which exposes the Client REST API as a set of convenient Node.js objects, and methods

HTH!

The Search API (e.g. search:search()) is an XQuery library that provides a high-level interface for some of the core capabilities of MarkLogic, such as search, facets, and aggregates. It uses the lower-level cts:* (and other) libraries under the covers, but will save most developers a bunch of typing and debugging.

In general, I'd recommend starting with the Search API. We've put a lot of effort into making sure it's robust and fast. For example, when doing faceted search, it orchestrates getting the search results and calculating facets from range indexes in parallel. There are many other examples of conveniences and best practices that you get out-of-the-box with the Search API. If you need to do something more or different than the Search API provides, there are several places that allow you to work with lower-level cts:query instances. For example, search:resolve() takes a cts:query and calls the equivalent of search:search().

Also, for those working in Server-Side JavaScript, the upcoming 8.0-4 release will introduce a similarly positioned high-level library designed specifically for JavaScript.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!