Commit graph

2 commits

Author SHA1 Message Date
d8de4083f5 **fix(cache): remove outdated ES module compatibility solution and enhance shims for 'os' and 'url' modules**
- Removed `SOLUTION.md` as it contained an outdated explanation of ES module compatibility fixes for cache detection.
- Updated `rollup.config.js`:
  - Added detailed shims for 'url' and 'os' modules to ensure proper functionality in browser environments:
    - **OS Shim**: Provided reasonable defaults for `totalmem()`, `freemem()`, `platform()`, and `arch()` to maintain compatibility and consistency.
    - **URL Shim**: Added `fileURLToPath` and `pathToFileURL` to handle browser-specific file paths.
  - Updated `nodeBuiltins` to include `'node:url'` and `'node:os'` for handling edge cases in module resolution.

**Purpose**: Streamline codebase by removing redundant documentation and enhancing compatibility shims for ES modules, ensuring seamless operation in browser environments.
2025-08-01 15:35:41 -07:00
f86295eab8 **feat(search): enhance JSON document search with field-level filtering and prioritization**
- Added support for field-specific and prioritized searches in `brainyData`:
  - Introduced `searchField` option to enable targeted field-level searches.
  - Implemented `priorityFields` option for weighted vectorization and query relevance.
- Developed utilities in `jsonProcessing.ts` and `fieldNameTracking.ts`:
  - `extractTextFromJson` for text extraction with customizable depth and field prioritization.
  - `extractFieldFromJson` to target specific fields in JSON documents.
  - `prepareJsonForVectorization` for optimized JSON vectorization.
- Enhanced management of field names and mappings:
  - Integrated `trackFieldNames` to associate fields with their services.
  - Supported cross-service consistency through `standardFieldMappings`.
- Updated documentation:
  - Added detailed guides for JSON search enhancements and HNSW limitations.
  - Extended usage examples in `README.md` and `json-search-test.js`.
- Verified improvements with comprehensive tests:
  - Created unit and integration tests demonstrating search behavior improvements.
  - Addressed previous TypeScript errors related to search parameters.

**Purpose**: Improve search accuracy and usability when working with complex JSON documents by enabling field-specific searches and enhancing contextual relevance.
2025-08-01 08:27:39 -07:00