marklogic / marklogic/java-client-api
queryManager.uris does not honor additional-query in search options
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 61
- Fork
- 74
- Merge trung bình
- 2 ngày 53 phút
- Pull request đã merge (30 ngày)
- 8
Mô tả
Version of MarkLogic Java Client API
6.5.0
Version of MarkLogic Server
11.0.2
Java version
JDK 17
OS and version
ProductName: macOS
ProductVersion: 13.5
BuildVersion: 22G74
Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end
The current issue is a follow-up of this one: https://github.com/marklogic/java-client-api/issues/1640
In the last issue you correctly mentioned that the correct format for search positive/negative is: positive-query and negative-query
However, the way I created the last issue is not 1:1 with the issue that we actually had. Our issue is actually the following:
executing a search query and passing an options name parameter (where the options contains an and-not-query looking for a collection is simply ignored in QueryBatcher, but it works for a simple search).
Let me help you a bit with a piece of code:
QueryManager queryManager= markLogicDatabaseClient.newQueryManager();
final RawCombinedQueryDefinition structQueryDef = queryManager
.newRawCombinedQueryDefinition(new StringHandle(
"<search xmlns=\"http://marklogic.com/appservices/search\">\n" +
" <query>\n" +
" <and-query>\n" +
" <term-query>\n" +
" <text>world</text>\n" +
" </term-query>\n" +
" </and-query>\n" +
" </query>\n" +
"</search>"), "all");
final SearchHandle result = queryManager.search(structQueryDef, new SearchHandle());
result.getMatchResults();
The content of "all.xml" contains (between other stuff):
<cts:and-not-query>
<cts:annotation type="searchable-collections"/>
<cts:positive>
<cts:collection-query>
<cts:uri>collection1</cts:uri>
<cts:uri>collection2</cts:uri>
</cts:collection-query>
</cts:positive>
<cts:negative>
<cts:collection-query>
<cts:uri>ignoredCollection</cts:uri>
</cts:collection-query>
</cts:negative>
</cts:and-not-query>
Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)
The output is correct for a simple search, the collections are filtered, but for QueryBatcher they are not.
Expected output: What specifically did you expect to happen?
The output is the same for both search and QueryBatcher (collections are taken into account)
Alternatives: What else have you tried, actual/expected?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu từ các entry point QueryManager.search và QueryBatcher, sử dụng bản tái hiện Java được cung cấp và nội dung các tùy chọn trong all.xml. So sánh cách tên tùy chọn và bộ lọc collection and-not-query của nó được áp dụng trong tìm kiếm đơn giản so với QueryBatcher. Hoàn thành khi cả hai đường dẫn đều trả về cùng các kết quả đã lọc theo collection, bao gồm việc loại trừ ignoredCollection.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 52/100