| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Version 1.0 - Compatible with IndxCloudApi 1.0.2 (using IndxSearchLib 4.1.2)
A Node.js TypeScript application for loading and configuring datasets in IndxCloudApi, the search server. This helper tool streamlines the process of importing data, configuring search fields, and setting up filters for optimal search performance.
IndxNodeLoader/ ├── src/ │ ├── index.ts # Entry point with CLI args and interactive menu │ ├── api/ │ │ └── load-api.ts # Main data loading logic with API calls │ ├── config/ │ │ └── dataset-config.ts # Dataset configurations (tmdb, pokedex) │ └── utils/ │ ├── console-helper.ts # Console output formatting utilities │ └── auth.ts # Authentication helpers ├── data/ # Dataset JSON files │ ├── tmdb_top10k.json │ └── pokedex.json ├── package.json # Node.js dependencies and scripts ├── tsconfig.json # TypeScript configuration └── .env.local.example # Environment configuration template
Key Files:
The project includes a pre-configured dataset of 10,000 top movies from The Movie Database (TMDB). Data sourced from TMDB.
Includes a Pokemon dataset for testing purposes. Pokemon data is property of Nintendo/Game Freak.
Clone the repository:
git clone https://github.com/indxSearch/IndxCloudLoader.git
cd IndxCloudLoaderInstall dependencies:
pnpm install
# or
npm installCreate your configuration file:
cp .env.local.example .env.localThen edit .env.local with your configuration:
API_URI=https://localhost:5001/
# Choose ONE authentication method:
BEARER_TOKEN=your-bearer-token-here
# OR
# USER_EMAIL=your-email@example.com
# USER_PASSWORD=your-passwordAuthentication Options:
You only need ONE of these authentication methods:
Bearer Token (Recommended): Most secure option
Email/Password (Alternative): The loader will login and obtain a token automatically
For local development: Use https://localhost:5001 as the API_URI For Azure deployment: Replace with your Azure API URL
You're ready! No code changes needed - dataset selection is now done via command-line or interactive menu.
Simply run without arguments to see an interactive menu:
pnpm dev
# or
npm run devYou'll see:
━━━ Dataset Selection ━━━ ? Select dataset: (Use arrow keys) ❯ 1. tmdb 2. pokedex 0. Exit
Specify the dataset directly:
# Load TMDB dataset
pnpm dev -- --dataset tmdb
# Or use short form
pnpm dev -- -d pokedexTo build and run the compiled version:
# Build TypeScript to JavaScript
pnpm build
# Run the compiled version
pnpm start -- --dataset tmdbpnpm dev -- --helpThe loader will:
The loader interacts with the following IndxCloudApi endpoints:
For complete API documentation, visit: https://localhost:5001/swagger
To add your own dataset:
Example - Adding a Products Dataset:
Edit src/config/dataset-config.ts and add:
case 'products':
return {
name: 'products',
filePath: 'data/products.json',
searchableFields: [
{ name: 'name', weight: Weight.High },
{ name: 'description', weight: Weight.Med },
{ name: 'tags', weight: Weight.Low }
],
wordIndexingFields: ['name'],
filterableFields: ['price', 'category', 'in_stock'],
facetableFields: ['category', 'brand'],
sortableFields: ['price', 'name'],
testQuery: 'laptop'
};Then add 'products' to the getAvailableDatasets() function.
Field Types Explained:
The TypeScript types in src/types/indx-search-lib.ts are based on the IndxCloudApi Swagger/OpenAPI specification.
To add or update types:
Check the API documentation:
https://localhost:5001/swagger
Find the schema definition for the type you need (e.g., CloudQuery, SystemStatus)
Update or add the interface in src/types/indx-search-lib.ts
Example: If the API adds a new filter type, you would:
The current types are complete for IndxSearchLib 4.1.2 but can be extended as the API evolves.
This project is licensed under the MIT License - see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |