This folder contains source code for a bulk-insert program that creates and loads an index using the good-books sample data in a CSV folder. It's the JavaScript version of the bulk-insert
content used in the C# sample Add search to websites. If you're a JavaScript developer, you can subtitute this code to create a JS version of the sample app.
You can also run this code standalone to create a good-books index on your search service.
-
Check your search service to make sure you have room for an extra index. The Usage tab in the Azure portal's search service page provides this information. The maximum limit on the free tier is 3 indexes. The maximum limit on the basic tier is 15 indexes.
-
Change the following values in the
bulk_insert_books.js
file:- YOUR-SEARCH-RESOURCE-NAME (not the full URL)
- YOUR-SEARCH-ADMIN-KEY
-
Open an integrated terminal in Visual Studio Code.
-
Make sure the path is "azure-search-static-web-app/javascript/bulk-insert".
-
Install the dependencies:
npm install
-
Run the program:
npm start
-
You should see the following output:
1000 ... 1999 BATCH SENT 2000 ... 2999 BATCH SENT 3000 ... 3999 BATCH SENT 4000 ... 4999 BATCH SENT 5000 ... 5999 BATCH SENT 6000 ... 6999 BATCH SENT 7000 ... 7999 BATCH SENT 8000 ... 8999 BATCH SENT 9000 ... 9999 BATCH SENT book list data inserted data inserted into index