0

I’m using Manticore Search 14.1.0 (Docker image manticoresearch/manticore:latest) on Ubuntu 20.04.6 LTS. I rely on cursor-style pagination with OPTION scroll, but when the sort clause includes a string column the scroll token is ignored and I just keep getting the first page.

Minimal reproducible example:

CREATE TABLE test (id BIGINT, brand_name STRING);
INSERT INTO test (id, brand_name) VALUES
  (1, 'A'),
  (2, 'A'),
  (3, 'B'),
  (4, 'B'),
  (5, 'C');

Page 1 works as expected:

SELECT * FROM test
ORDER BY brand_name DESC, id DESC
LIMIT 2;
/*
+------+------------+
| id   | brand_name |
+------+------------+
|    5 | C          |
|    4 | B          |
+------+------------+
*/

The SHOW SCROLL; command returns a token (decoded form shown for clarity):

{
  "order_by_str": "brand_name desc, id desc",
  "order_by": [
    { "attr": "brand_name", "desc": true, "value": "B", "type": "string" },
    { "attr": "id", "desc": true, "value": 4, "type": "int" }
  ]
}

But passing that token straight back still gives me the first page:

SELECT * FROM test
ORDER BY brand_name DESC, id DESC
LIMIT 2
OPTION scroll='eyJvcmRlcl9ieV9zdHIiOiJicmFuZF9uYW1lIGRlc2MsIGlkIGRlc2MiLCJvcmRlcl9ieSI6W3siYXR0ciI6ImJyYW5kX25hbWUiLCJkZXNjIjp0cnVlLCJ2YWx1ZSI6IkIiLCJ0eXBlIjoic3RyaW5nIn0seyJhdHRyIjoiaWQiLCJkZXNjIjp0cnVlLCJ2YWx1ZSI6NCwidHlwZSI6ImludCJ9XX0=';

Expected result for page 2:

+------+------------+
| id   | brand_name |
+------+------------+
|    3 | B          |
|    2 | A          |
+------+------------+

Actual result:

+------+------------+
| id   | brand_name |
+------+------------+
|    5 | C          |
|    4 | B          |
+------+------------+

Has anyone found a way to get OPTION scroll to advance when sorting by a string column (with a secondary numeric tie-breaker), or is this simply unsupported right now?

2
  • If it works for other columns / datatypes, I'd raise it with the vendor as a possible bug. Commented Nov 12 at 21:43
  • It is working for integers, but not for string datatyped column. Commented Nov 13 at 9:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.