Prevent access to index.json

I don’t know if this is a hugo question or more related to hosting (I’m using aws s3).

I’m generating an index.json file for search and I would like to prevent users from accessing the file by going to

I think it’s a hosting issue. Using apache, you could put a line in .htaccess or your robots.txt to try to avoid having people access that file. Using AWS S3, it’s perhaps a matter of accessing the file and setting security on it?

This is how to allow it:

So perhaps setting a less permissive setting will allow you to block that one file. Not sure, sorry.

What type of search is it? Server-side or client?

For what?

There’s a UI for redirects in S3:

Thanks for the input. I’m using Algolia instantsearch.js for search.