typesense / typesense

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Home Page:https://typesense.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A preceding newline is returned when importing a specific record

veenman opened this issue · comments

Description

When importing one specific record (as part of a collection of approximately 3.2 million records) Typesense returns a newline preceding {"success":true}. Because of this the parsing of the returned JSON result fails.

Steps to reproduce

It happens when importing one specific record. Record in JSON format

The problem occurs with version 0.26.0.rc64. When switching to version 0.25.2, the problem doesn't occur.

Expected Behavior

The return of {"success":true} without the preceding newline.

Actual Behavior

The return of {"success":true} with the preceding newline.

Metadata

Typesense Version: 0.26.0.rc64

@veenman

Can you please tell me which client you are facing this problem with? Does it happen with curl as well?

The problem occurred when using Laravel Scout. I dug into the code until I reached Documents.php of the official Typesense PHP client. There I dumped the value of $resultsInJSONLFormat which is returned on line 146 as the result of a POST request made by the API class. So I suppose it is the literal value that is being returned by guzzle/curl.

I've identified the issue and will have a fix for this shortly.

@veenman

Can you please try on 0.26.0.rc65

When using 0.26.0.rc65 the problem doesn't occur. To make sure the problem is solved, I also switched back to 0.26.0.rc64. After executing the same command, the problem does (again) occur. So I can confirm the problem experienced has been resolved.

Thank you for the quick resolution!

Great, thank you for confirming.