Skip to content

Invalid characters in MC break search API #10

Open
@syxie

Description

@syxie

Adding messages like this to MC seems to break the ability of the client to fetch them:
'msg': '[\x02L\u200bi\u200bl\u200bB\u200br\u200bu\u200bc\u200be\x02] sss'

Indexing with the client works fine:
{'error': None,
'items': [{'bulk': {'_id': 1370872170497990695,
'_index': 'main',
'created': 1,
'deleted': 0,
'result': 'created',
'status': 201,
'updated': 0}}]}

However, on search, these are the results:
{'took': None, 'timed_out': None, 'aggregations': None, 'hits': None, 'profile': None, 'warning': None}

In the server query log at the same time, I can see that this did in fact return results the client is not displaying.
/* Thu Sep 8 14:54:48.419 2022 conn 2 real 0.001 wall 0.002 found 73

Using requests seems to work:
response = requests.post(f"{settings.MANTICORE_URL}/json/search", json=search_query)
response = ujson.loads(response.text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions