#community-help

Issue Downloading Data via browseObject Method from Algolia

TLDR Nikunj faced issues while downloading data from Algolia using the browseObject method. Kishore Nallan suggested checking if the 'index' was properly initialized.

Powered by Struct AI
Jan 30, 2023 (8 months ago)
Nikunj
Photo of md5-e86f551204439999ca28639ea0e038b0
Nikunj
10:42 AM
While downloading all my data from algolia , I have been facing this issue from last couple of hours
I am using browseObject method
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:48 AM
Can you post the client code used?
Nikunj
Photo of md5-e86f551204439999ca28639ea0e038b0
Nikunj
10:50 AM
downloadData: () => {
        let hits = []
        index
            .browseObjects({
                query: '',

                batch: batch => {
                    hits = hits.concat(batch)
                },
            })
            .then(() => {
                console.log(hits)
            })
    }
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:54 AM
I think index is not initialised properly. Try printing the value of index.
Nikunj
Photo of md5-e86f551204439999ca28639ea0e038b0
Nikunj
11:05 AM
same index is being used for every other function like deleteObject.
partialUpdateObjects ,etc but working fine.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:09 AM