當我使用REST API使用http://localhost:8003/v1/search?q=harry&format=json進行基本搜索時,我從包含harry的所有文檔中得到MarkLogic的結果。從Marklogic搜索有關的所有匹配文件回覆
{
"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"
}
}
但是我希望響應不僅僅包含文檔的信息,還要返回文檔。這樣我就不必再單獨打電話來獲取文件了。