| 499 | } |
| 500 | |
| 501 | private isDefinitionHeavyResult(chunk: CodeChunk): boolean { |
| 502 | const normalizedPath = chunk.filePath.toLowerCase().replace(/\\/g, '/'); |
| 503 | const componentType = (chunk.componentType || '').toLowerCase(); |
| 504 | |
| 505 | if (['type', 'interface', 'enum', 'constant'].includes(componentType)) return true; |
| 506 | |
| 507 | return ( |
| 508 | normalizedPath.includes('/models/') || |
| 509 | normalizedPath.includes('/interfaces/') || |
| 510 | normalizedPath.includes('/types/') || |
| 511 | normalizedPath.includes('/constants') |
| 512 | ); |
| 513 | } |
| 514 | |
| 515 | private scoreAndSortResults( |
| 516 | query: string, |