當我嘗試使用search:estimate
獲得總搜索結果時,我得到錯誤的結果..當我嘗試從search:search
解析總數時,它也給我錯誤或從一個頁面到另一頁我得到不同的總數。獲取marklogic中確切總搜索結果的最佳方法
我怎樣才能得到我的搜索字符串的確切數量?
--- XXXX編輯的問題------
我的數據庫由JSON文件,而這些文件JSON在結構層次。例如:以下是樣本,我保留在帖子的結尾..抱歉粘貼我的整個JSON結構,但我認爲你明白了。
我已創建字段/字段範圍指數的某些元素,例如
concept_species /species
concept_name /name
concept_registrar /registrar/name
cept_scientist /scientist/name
concept_supplier /suppliers/name
concept_entitySubType /entitySubType
concept_entityType /entityType
concept_createdDate /createdDate
concept_project /project/name
concept_moniker /moniker
當我搜索有其中之一的「約束」,那麼我xdmp:估計是很好..但是當我沒有任何的限制,這些對我的搜索字符串,然後xdmp :估計是關閉..我的搜索結果很好,但..所有的指標似乎很好?爲什麼是這種情況?因此我回到了總搜索結果的fn:count。
這可能與此問題無關,但爲了完整起見,我添加了這個..我創建了一個自定義約束,它基本上將約束轉換爲json中的路徑。例如:let我們說用戶想要搜索一個名稱爲「ATCC」的供應商..因此,我沒有在整個路徑中輸入用戶,而是創建了一個自定義約束,其中將像json結構一樣,並且我的constriant將其轉換爲實際的json路徑..所以在這種情況下,搜索字符串像這樣:((concept:suppliers.name:(ATCC))))
,我的定製約束concept
將它轉換爲以下CT:查詢
<cts:json-property-scope-query xmlns:cts="http://marklogic.com/cts">
<cts:property>suppliers</cts:property>
<cts:json-property-scope-query>
<cts:property>name</cts:property>
<cts:word-query>
<cts:text xml:lang="en">ATCC</cts:text>
<cts:option>case-insensitive</cts:option>
<cts:option>punctuation-insensitive</cts:option>
<cts:option>whitespace-insensitive</cts:option>
<cts:option>wildcarded</cts:option>
</cts:word-query>
</cts:json-property-scope-query>
</cts:json-property-scope-query>
這是我的JSON文件結構
{
"moniker": "",
"entityType": "",
"entitySubType": "",
"abbvNumber": "",
"bioSafetyLevel": "",
"name": "",
"extCorpID": "",
"extLotID": "",
"selectAgent": "",
"comments": "",
"nucleotideSeq": {
"seq": ""
},
"chains": [
{
"chainType": "",
"name": "",
"plasmidLotID": "",
"stochiometry": 0,
"aminoAcids": [
{
"sequence": "",
"predictedMatureSeqs": [
{
"encodedChainName": "",
"encodedChainType": "",
"sequence": "",
"domains": [
{
"allotype": "",
"domainType": "",
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
]
}
],
"domains": [
{
"allotype": "",
"domainType": "",
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
]
}
],
"constructs": [
{
"plasmidID": "",
"precursorAminoAcidSeq": ""
}
]
}
],
"supplier": {
"name": "",
"productID": "",
"atccCatalogNumber": "",
"lotID": ""
},
"preparation": {
"type": "",
"lotIDs": [
""
],
"amminoAcidDerivatization": "",
"chemicalConjugations": [
{
"name": "",
"dar": ""
}
],
"peptidateTreatment": "",
"proteinTreatment": "",
"purification": "",
"expressionSystem": "",
"empty": false
}
},
"project": {
"name": "",
"status": ""
},
"registrar": {
"username": "",
"email": "",
"name": "",
"upi": "",
"admin": false,
"curator": false,
"approvedUser": false
},
"scientist": {
"username": "",
"email": "",
"name": "",
"upi": "",
"admin": false,
"curator": false,
"approvedUser": false
},
"notebook": {
"elnPage": "",
"upi": "",
"location": "",
"subpage": ""
},
"growthFS": {
"mediumUsed": "",
"otherComponents": "",
"percentCO2": 0,
"percentHumudity": 0,
"percentSerum": 0,
"selectionMarker": "",
"spinnerPlateSpeed": 0,
"temp": 0,
"drugResistance": "",
"growthConditions": "",
"passageNumber": ""
},
"origin": {
"dateOfTransfection": "",
"hcAntibodyIsotype": "",
"lcAntibodyIsotype": "",
"parentCellLineLotID": "",
"parentChildRel": "",
"parentTissueSpecies": "",
"strain": "",
"tissueSource": "",
"celllineMemID": "",
"dateFrozen": "",
"strFingerprint": "",
"plasmidLotIDs": [
""
]
},
"miscellaneous": {
"expHostType": "",
"selEukaryote": "",
"selProkaryote": "",
"buffer": "",
"enotoxinLevel": "",
"enotoxinUnit": "",
"enotoxinMethod": "",
"concentrationLevel": "",
"concentrationUnit": "",
"concentrationMethod": "",
"mixture": "",
"proteinMw": 0
},
"nucleotideSeq": {
"seq": ""
},
"preparation": {
"type": "",
"lotIDs": [
""
],
"amminoAcidDerivatization": "",
"chemicalConjugations": [
{
"name": "",
"dar": ""
}
],
"peptidateTreatment": "",
"proteinTreatment": "",
"purification": "",
"expressionSystem": "",
"empty": false
},
"adc": {
"dars": [
{
"value": 0,
"method": "",
"precision": "",
"empty": false
}
],
"aggregations": [
{
"percentAggMethod": "",
"percentAggValue": 0
}
]
},
"createdBy": "",
"createdDate": "",
"modifiedBy": "",
"modifiedDate": "",
"alternateName": "",
"chains": [
{
"chainType": "",
"name": "",
"plasmidLotID": "",
"stochiometry": 0,
"aminoAcids": [
{
"sequence": "",
"predictedMatureSeqs": [
{
"avgMolWt": 0,
"encodedChainName": "",
"encodedChainType": "",
"length": 0,
"sequence": "",
"domains": [
{
"allotype": "",
"domainType": "",
"domainEnd": 0,
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"domainStart": 0,
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
]
}
],
"domains": [
{
"allotype": "",
"domainType": "",
"domainEnd": 0,
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"domainStart": 0,
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
]
}
],
"constructs": [
{
"plasmidID": "",
"precursorAminoAcidSeq": ""
}
]
}
],
"orfs": [
{
"orfEnd": 0,
"intronsPresent": "",
"orfStart": 0,
"promoters": [
""
],
"aminoAcids": [
{
"sequence": "",
"predictedMatureSeqs": [
{
"encodedChainName": "",
"encodedChainType": "",
"length": 0,
"sequence": "",
"domains": [
{
"allotype": "",
"domainType": "",
"domainEnd": 0,
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"domainStart": 0,
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
]
}
],
"domains": [
{
"allotype": "",
"domainType": "",
"domainEnd": 0,
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"domainStart": 0,
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
]
}
],
"ncSeq": {
"seq": ""
},
"label": "",
"note": ""
}
],
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
],
"immunogens": [
{
"type": "",
"name": "",
"entrezgeneID": "",
"geneSymbol": "",
"corporateID": "",
"species": "",
"lotID": "",
"sequence": ""
}
],
"suppliers": [
{
"name": "",
"productID": "",
"atccCatalogNumber": "",
"lotID": ""
}
],
"domains": [
{
"allotype": "",
"domainType": "",
"domainEnd": 0,
"entrezgeneID": "",
"geneSymbol": "",
"heavyChainIsoType": "",
"lightChainIsoType": "",
"name": "",
"regonizedAntigenFK": "",
"species": "",
"domainStart": 0,
"heavyChainIsoTypeMutation": "",
"antigens": [
{
"antiIdiotypeType": "",
"antibodyAntigen": "",
"corporateID": "",
"description": "",
"entrezgeneID": "",
"geneSymbol": "",
"name": "",
"relatedProtein": "",
"sequence": "",
"species": "",
"type": "",
"externalID": ""
}
]
}
}
您可能需要重構您的文檔,以便它們與您的搜索查詢和表達式是一對一的。但是,沒有示例XML和查詢,就不可能提出建議。 – wst
我更新了我的問題,詳細瞭解了我的文檔結構以及我如何進行搜索 – Ravi