Skip to content

Commit 2df17a4

Browse files
TarunCoredananjay-s
authored andcommitted
fix/fts index insights API response structure
Change-Id: Idb878601de177f8d455364ab54422b5bf974e257 Reviewed-on: https://review.couchbase.org/c/testrunner/+/247670 Tested-by: Tarun E <tarun.elangovan@couchbase.com> Reviewed-by: <dananjay.s@couchbase.com>
1 parent 79e0532 commit 2df17a4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pytests/fts/fts_base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5905,8 +5905,12 @@ def validate_index_insights(self, index_name, field, insight="termFrequencies",
59055905
self.assertTrue(response is not None,
59065906
"Index insights returned None for {0}".format(insight))
59075907

5908+
# The insights endpoint returns the data under a top-level key named
5909+
# after the requested insight, e.g.
5910+
# {"status": "ok", "request": {...},
5911+
# "termFrequencies": [{"term": "sr", "frequency": 4348}, ...]}
59085912
if isinstance(response, dict):
5909-
results = response.get("results", response.get("entries", []))
5913+
results = response.get(insight, [])
59105914
elif isinstance(response, list):
59115915
results = response
59125916
else:

0 commit comments

Comments
 (0)