manticoresoftware / manticoresearch-python

Official Python client for Manticore Search
MIT License
41 stars 7 forks source link

Invalid characters in MC break search API #10

Open syxie opened 2 years ago

syxie commented 2 years ago

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)

sanikolaev commented 2 years ago

Can you make an MRE similar to this one https://github.com/manticoresoftware/manticoresearch/issues/863#issuecomment-1221909056 ?

syxie commented 2 years ago

Ah, this issue seems to be a duplicate of that one, and by extension https://github.com/manticoresoftware/manticoresearch/issues/857

sanikolaev commented 2 years ago

@syxie in that issue the problem is with \x0b. Can you find out what the problem is in this one?