【发布时间】:2017-04-27 10:41:40
【问题描述】:
当我使用 http://localhost:8003/v1/search?q=harry&format=json 使用 REST API 进行基本搜索时,我从 MarkLogic 获得了所有包含 harry 的文档的结果。
{
"snippet-format": "snippet",
"total": 2,
"start": 1,
"page-length": 10,
"results": [
{
"index": 1,
"uri": "/store/books/children/c1",
"path": "fn:doc(\"/store/books/children/c1\")",
"score": 16384,
"confidence": 0.5254987,
"fitness": 0.6964535,
"href": "/v1/documents?uri=%2Fstore%2Fbooks%2Fchildren%2Fc1",
"mimetype": "application/xml",
"format": "xml",
"matches": [
{
"path": "fn:doc(\"/store/books/children/c1\")/book/title",
"match-text": [
{
"highlight": "Harry"
},
" Potter"
]
}
]
},
{
"index": 2,
"uri": "/store/books/children/c2",
"path": "fn:doc(\"/store/books/children/c2\")",
"score": 16384,
"confidence": 0.5254987,
"fitness": 0.6964535,
"href": "/v1/documents?uri=%2Fstore%2Fbooks%2Fchildren%2Fc2",
"mimetype": "application/xml",
"format": "xml",
"matches": [
{
"path": "fn:doc(\"/store/books/children/c2\")/book/title",
"match-text": [
{
"highlight": "Harry"
},
" Potter Part 1"
]
}
]
}
],
"qtext": "harry",
"metrics": {
"query-resolution-time": "PT0.0038395S",
"snippet-resolution-time": "PT0.001753S",
"total-time": "PT0.0068583S"
}
}
但我希望响应不仅包含文档信息,而且还返回文档。这样我就不必单独调用来获取文档了。
【问题讨论】:
标签: marklogic marklogic-8