简体   繁体   English

服务器端javascript或node.js中的Marklogic结构化查询

[英]Marklogic structured query in server side javascript or node.js

Is it possible to perform a structured query on server side javascript (via cts.* or jsearch.* ) or on Node.js API? 是否可以在服务器端javascript(通过cts.*jsearch.* )或Node.js API上执行结构化查询?

According to documentation ( https://docs.marklogic.com/guide/search-dev/structured-query#id_47703 ) it might only be possible only via XQuery, Java or REST API. 根据文档( https://docs.marklogic.com/guide/search-dev/structured-query#id_47703 ),可能只能通过XQuery,Java或REST API进行。

I was under the impression that XQuery and server side javascript implementation be have the same functionalities. 我的印象是XQuery和服务器端javascript实现具有相同的功能。

Equivalent expressive power does not necessarily mean identical interfaces. 等效的表达能力不一定表示相同的接口。

Structured query is primarily intended for use with the REST, Java, and Node.js Client APIs. 结构化查询主要用于REST,Java和Node.js客户端API。 Use the Node.js Client API queryBuilder interface to construct a structured query. 使用Node.js客户端API queryBuilder接口构造结构化查询。 See http://docs.marklogic.com/guide/node-dev/search#id_28266 . 请参阅http://docs.marklogic.com/guide/node-dev/search#id_28266

Alternatively, if you do not want to use the builder for some reason, you can roll your own combined query that contains a structured query. 或者,如果由于某种原因不想使用构建器,则可以滚动自己的包含结构化查询的组合查询。 See http://docs.marklogic.com/guide/node-dev/search#id_57610 . 请参阅http://docs.marklogic.com/guide/node-dev/search#id_57610

On the server side, the recommended search API for JS is jsearch. 在服务器端,推荐的JS搜索API是jsearch。 See http://docs.marklogic.com/js/jsearch and http://docs.marklogic.com/guide/search-dev/javascript#chapter . 请参阅http://docs.marklogic.com/js/jsearchhttp://docs.marklogic.com/guide/search-dev/javascript#chapter Jsearch operates on cts:queries. Jsearch在cts:queries上运行。 Structured query is really just a thin layer over cts:query. 结构化查询实际上只是cts:query的薄薄一层。

It is possible to call search:resolve (as search.resolve) from JS, just like any other XQuery library, but it is XML-centric, so it is not very convenient to use it from JS. 可以像其他XQuery库一样从JS调用search:resolve(作为search.resolve),但是它以XML为中心,因此从JS使用它不是很方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM