Невозможно исключить критерии sectionName = "PI"
для основных результатов поиска с использованием структурированного запроса MarkLogic.
пример - рассмотрим эти два документа в БД.
test1.json
{
"id" : "101",
"sectionName" : "PI",
"name" : "Myself",
"emailId" : "aaa@gmail.com"
}
test2.json
{
"id" : "101",
"sectionName" : "GD",
"name" : "Prof",
"emailId" : "aaa@gmail.com"
}
Ниже приведен пример кода, который я пробовал:
"not-query":{
"value-query":{
"json-property":"sectionName",
"text":["PI"],
"term-option":["exact"]
}
}
Resulset по-прежнему отображает документ, содержащий sectionName = "PI", т. Е. Test1.json не исключается.
Просьба предложить в этом.
Добавление search_Document_test xml.
<?xml version="1.0" encoding="UTF-8"?>
<options xmlns="http://marklogic.com/appservices/search">
<search-option>unfiltered</search-option>
<page-length>1</page-length>
<term apply="term">
<empty apply="all-results">
</empty>
<term-option>case-sensitive</term-option>
<term-option>punctuation-insensitive</term-option>
<term-option>diacritic-insensitive</term-option>
</term>
<grammar>
<quotation>"</quotation>
<implicit>
<cts:and-query strength="20" xmlns:cts="http://marklogic.com/cts">
</cts:and-query>
</implicit>
<starter strength="30" apply="grouping" delimiter=")">(</starter>
<joiner strength="10" apply="infix" element="cts:or-query" tokenize="word">OR</joiner>
<joiner strength="30" apply="infix" element="cts:near-query" tokenize="word">NEAR</joiner>
<joiner strength="30" apply="near2" consume="2" element="cts:near-query">NEAR/</joiner>
<joiner strength="50" apply="constraint">:</joiner>
<joiner strength="50" apply="constraint" compare="LT" tokenize="word">LT</joiner>
<joiner strength="50" apply="constraint" compare="LE" tokenize="word">LE</joiner>
<joiner strength="50" apply="constraint" compare="GT" tokenize="word">GT</joiner>
<joiner strength="50" apply="constraint" compare="GE" tokenize="word">GE</joiner>
<joiner strength="50" apply="constraint" compare="NE" tokenize="word">NE</joiner>
</grammar>
<sort-order direction="descending">
<score>
</score>
</sort-order>
<constraint name="Collection">
<collection></collection>
</constraint>
<extract-document-data selected="include">
<extract-path>/URI</extract-path>
</extract-document-data>
</options>