Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

CloudantV1.postPartitionSearch does not return order field in Node.JS

Đang mở
#1,877 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
nodejs, typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu tại điểm vào CloudantV1.postPartitionSearch và kiểm tra cách phản hồi tìm kiếm của nó được biểu diễn trong Node.js SDK. So sánh các hàng được trả về với các phản hồi được ghi lại và phản hồi của Python, tập trung vào trường order bị thiếu. Công việc được hoàn tất khi mỗi kết quả bao gồm mảng order như mong đợi mà không làm hỏng các trường phản hồi khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

CloudantV1.postPartitionSearch method should return an order field with each result, containing the relevance score. This works when using the Python library, however, it does not work in Node.JS using @ibm-cloud/cloudant package.

To Reproduce

In Node.JS, create an API that uses CloudantV1.postPartitionSearch. The result is missing the order field. Example response in Node.JS:
{"totalRows":4,"bookmark":"g2wAAAA...","rows":[{"fields":{"FormNumber":"SG24-8573-00"},"id":"rb:SG24-8573-00"}...
Using the same database, same partition, same method and same query, an equivalent Python script correctly returns the order field for each result.
Example response in Python:
{'total_rows': 4, 'bookmark': 'g2wAAAA...', 'rows': [{'id': 'rb:SG24-8573-00', 'order': [0.910089373588562, 2766], 'fields': {'FormNumber': 'SG24-8573-00'}...

Expected behavior

As per Cloudant documentation:
The response to a search query includes an order field for each of the results. The order field is an array where the first element is the field or fields that are specified in the sort parameter.

Screenshots

Must gather (please complete the following information):

  • SDK version 0.12.7
  • Node.js Version 20
  • Name of service that you're trying to use: @ibm-cloud/cloudant in Node.JS
  • method CloudantV1.postPartitionSearch

Additional context

No workaround found using the Node.JS library. The order field is simply missing from the response.

Ngôn ngữ chính
TypeScript
Star
29
Fork
16
Merge trung bình
17 giờ 38 phút
Pull request đã merge (30 ngày)
38

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của IBM/cloudant-node-sdk

Tất cả issue của IBM/cloudant-node-sdk

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.