QueryOptionsBuilder Deprecation

こ雲淡風輕ζ 提交于 2020-02-24 05:13:32

问题


As seen on http://developer.marklogic.com/learn/java/analytics, you are able to do faceted searches with the JavaAPI. However, the examples on that page use QueryOptionsBuilder, which has been deprecated.

Is there an alternative to using QueryOptionsBuilder in the JavaAPI to do faceted searches at this time? Or are we stuck using a deprecated class until some future release?

Thanks!


回答1:


Yes, there is an alternative. You can send or receive query options as JSON or XML instead of using the deprecated builder.

To expand a bit, the QueryOptionsManager.writeOptions() method accepts any class that implements the QueryOptionsWriteHandle marker interface. Besides the QueryOptionsHandle class, implementing classes include the write handles for JSON or XML.

Similarly, the readOptions() method accepts the classes that implement the QueryOptionsReadHandle marker interface, which include the read handles for JSON or XML.

  • http://docs.marklogic.com/javadoc/client/com/marklogic/client/admin/QueryOptionsManager.html
  • http://docs.marklogic.com/javadoc/client/com/marklogic/client/io/marker/QueryOptionsWriteHandle.html
  • http://docs.marklogic.com/javadoc/client/com/marklogic/client/io/marker/QueryOptionsReadHandle.html



回答2:


At http://docs.marklogic.com/javadoc/client/com/marklogic/client/admin/config/QueryOptions.html I see: "use a JSON or XML handle instead to write or read query options." I think that refers to http://docs.marklogic.com/javadoc/client/com/marklogic/client/query/QueryManager.html - and http://docs.marklogic.com/javadoc/client/overview-summary.html may help too.



来源:https://stackoverflow.com/questions/18448945/queryoptionsbuilder-deprecation

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