You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added _score-based sorting support with order configuration, updated existing integration tests to include new sorting parameters, enhanced text normalization with TextCleaner utility, documented new query profiling and debugging features in README, and introduced DTOs for detailed query and scoring analysis.
Copy file name to clipboardExpand all lines: README.md
+268Lines changed: 268 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,26 @@ A Model Context Protocol (MCP) server that exposes Apache Lucene fulltext search
18
18
- Structured passages with quality metadata for LLM consumption
19
19
- Paginated results with filter suggestions
20
20
21
+
🔬 **Query Profiling & Debugging**
22
+
- Deep query analysis and profiling (`profileQuery` tool)
23
+
- Understand why queries return certain results and how scoring works
24
+
- Filter impact analysis showing document reduction per filter
25
+
- Document scoring explanations with BM25 breakdown
26
+
- Term statistics (IDF, rarity, document frequency)
27
+
- Actionable optimization recommendations
28
+
- LLM-optimized structured output for easy interpretation
29
+
21
30
📄 **Rich Metadata Extraction**
22
31
- Automatic language detection
23
32
- Author, title, creation date extraction
24
33
- File type and size information
25
34
- SHA-256 content hashing for change detection
26
35
36
+
🧹 **Text Normalization**
37
+
- Automatic removal of broken/invalid characters (�, control chars, zero-width chars)
38
+
- Whitespace normalization (multiple spaces collapsed to single space)
39
+
- Ensures clean, readable search results and passages
40
+
27
41
⚡ **Performance Optimized**
28
42
- Batch processing for efficient indexing
29
43
- NRT (Near Real-Time) search with dynamic optimization
@@ -334,6 +348,15 @@ lucene:
334
348
335
349
## Available MCP Tools
336
350
351
+
**Quick Reference - Most Important Tools:**
352
+
- 🔍 **`search`** - Search documents with full Lucene query syntax and structured filters
353
+
- 🔬 **`profileQuery`** - Debug and optimize queries with detailed analysis and scoring explanations
354
+
- 🗂️ **`indexAdmin`** - Visual UI for index maintenance (optimize, purge, unlock)
355
+
- 📊 **`getIndexStats`** - View index statistics and document count
356
+
- 🚀 **`startCrawl`** - Index documents from configured directories
357
+
358
+
---
359
+
337
360
### `indexAdmin`
338
361
339
362
An [MCP App](https://github.com/modelcontextprotocol/ext-apps) that provides a visual user interface for index maintenance tasks directly inside your MCP client (e.g. Claude Desktop). When invoked, the app is rendered inline in the conversation and offers one-click access to administrative operations without requiring manual tool calls.
@@ -362,6 +385,44 @@ Search the Lucene fulltext index using **lexical matching** (exact word forms on
362
385
- `filters` (optional): Array of structured filters for precise field-level filtering (see **Structured Filters** below)
> **🌟 Powerful debugging tool for understanding search behavior, scoring, and performance**
562
+
563
+
Analyze and profile a search query to understand its behavior, performance, and scoring characteristics. This tool provides detailed insights into how Lucene processes your query, which terms contribute to scoring, how filters affect results, and where optimization opportunities exist.
564
+
565
+
**✨ Key Benefits:**
566
+
- 🐛 **Debug** why certain documents match or don't match
567
+
- 📊 **Understand** why documents are ranked in a particular order
568
+
- ⚡ **Optimize** slow queries by identifying expensive operations
569
+
- 🎯 **Analyze** filter effectiveness and selectivity
570
+
- 📈 **Learn** which query terms are most/least discriminative
571
+
- 🤖 **LLM-optimized** output format for AI-assisted query tuning
572
+
573
+
**Parameters:**
574
+
-`query` (optional): The search query (same as `search` tool)
575
+
-`filters` (optional): Array of structured filters (same as `search` tool)
-`pageSize` (optional): Results per page (default: 10, max: 100)
578
+
-`analyzeFilterImpact` (optional): If `true`, analyzes how each filter reduces result count. **WARNING:** Expensive operation requiring multiple queries. Default: `false`
579
+
-`analyzeDocumentScoring` (optional): If `true`, provides detailed scoring explanations for top documents using Lucene's Explanation API. **WARNING:** Expensive operation. Default: `false`
0 commit comments