{"slug": "check-macos-spotlight-semantic-indexing-readiness", "title": "Check macOS Spotlight semantic indexing readiness", "summary": "A developer published a JXA script that queries macOS Spotlight's CoreSpotlight indexing pipeline to report semantic search readiness, exposing the same XPC request used by CSSearchableIndex's fetchIndexingPipelineOverallCompleteness. The tool connects to the com.apple.spotlight.IndexAgent Mach service and decodes the CSIndexingPipelineOverallCompleteness report, printing overall completeness, donation and pipeline percentages, the sufficiency threshold, and report age.", "body_md": "|  | // Spotlight semantic search readiness, as reported by CoreSpotlight. | \n|  | // Usage: osascript -l JavaScript readiness.js [pipeline] (default: Embedding) | \n|  | // Or paste into Script Editor and pick JavaScript instead of AppleScript language | \n|  | ObjC.import('CoreSpotlight'); | \n|  | const bind = (name, signature) => ObjC.bindFunction(name, signature); | \n|  | bind('xpc_connection_create_mach_service', ['pointer', ['char *', 'pointer', 'unsigned long long']]); | \n|  | bind('xpc_connection_set_event_handler', ['void', ['pointer', 'id']]); | \n|  | bind('xpc_connection_resume', ['void', ['pointer']]); | \n|  | bind('xpc_connection_send_message_with_reply_sync', ['pointer', ['pointer', 'pointer']]); | \n|  | bind('xpc_dictionary_create', ['pointer', ['pointer', 'pointer', 'unsigned long']]); | \n|  | bind('xpc_dictionary_set_string', ['void', ['pointer', 'char *', 'char *']]); | \n|  | bind('xpc_dictionary_set_uint64', ['void', ['pointer', 'char *', 'unsigned long long']]); | \n|  | bind('xpc_dictionary_get_data', ['pointer', ['pointer', 'char *', 'pointer']]); | \n|  | bind('xpc_dictionary_get_uint64', ['unsigned long long', ['pointer', 'char *']]); | \n|  | bind('xpc_dictionary_get_int64', ['long long', ['pointer', 'char *']]); | \n|  | function run(argv) { | \n|  | const pipeline = argv[0] \\|\\| 'Embedding'; | \n|  | // Same request -[CSSearchableIndex fetchIndexingPipelineOverallCompleteness:completionHandler:] sends | \n|  | const connection = $.xpc_connection_create_mach_service('com.apple.spotlight.IndexAgent', null, 0); | \n|  | $.xpc_connection_set_event_handler(connection, ObjC.block(['void', ['pointer']], () => {})); | \n|  | $.xpc_connection_resume(connection); | \n|  | const request = $.xpc_dictionary_create(null, null, 0); | \n|  | $.xpc_dictionary_set_uint64(request, 'id', 1); | \n|  | $.xpc_dictionary_set_string(request, 'command', 'fetch-indexing-pipeline-completeness'); | \n|  | $.xpc_dictionary_set_string(request, 'command-type', 'index-type'); | \n|  | $.xpc_dictionary_set_string(request, 'n', 'CSSearchableIndexShared'); | \n|  | $.xpc_dictionary_set_uint64(request, 'iopt', 0); | \n|  | $.xpc_dictionary_set_string(request, 'indexing-pipeline', pipeline); | \n|  | const reply = $.xpc_connection_send_message_with_reply_sync(connection, request); | \n|  | // Nonzero status: unknown pipeline, or no report yet (first minutes after install) | \n|  | if (Number($.xpc_dictionary_get_int64(reply, 'status')) !== 0) return `No report for ${pipeline}`; | \n|  | const size = $.xpc_dictionary_get_uint64(reply, 'indexing-pipeline-completeness-size'); | \n|  | const bytes = $.xpc_dictionary_get_data(reply, 'indexing-pipeline-completeness', null); | \n|  | const report = $.NSKeyedUnarchiver.unarchivedObjectOfClassFromDataError( | \n|  | $.NSClassFromString('CSIndexingPipelineOverallCompleteness'), $.NSData.dataWithBytesLength(bytes, size), null); | \n|  | const value = key => ObjC.unwrap(report.valueForKey(key)); | \n|  | const percent = key => value(key) == null ? 'n/a' : (value(key) * 100).toFixed(1) + '%'; | \n|  | const status = value('isSufficientlyComplete') ? 'Ready' : 'Still processing'; | \n|  | return [ | \n|  | `Search readiness: ${percent('overallCompleteness')} — ${status} (${percent('sufficientlyCompleteThreshold')} required)`, | \n|  | `Known app items donated: ${percent('donationCompeleteness')}`, | \n|  | `Search pipeline processed: ${percent('pipelineCompleteness')}`, | \n|  | `Report age: ${(value('pipelineReportAge') / 3600).toFixed(1)} hours`, | \n|  | ].join('\\n'); | \n|  | } |", "url": "https://wpnews.pro/news/check-macos-spotlight-semantic-indexing-readiness", "canonical_source": "https://gist.github.com/pointum/22aaa925df98497a40a61d71f0d95a06", "published_at": "2026-09-24 00:59:58+00:00", "updated_at": "2026-09-24 01:56:56.140971+00:00", "lang": "en", "topics": ["ai-search", "developer-tools"], "entities": ["Apple", "macOS", "Spotlight", "CoreSpotlight", "CSSearchableIndex"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/check-macos-spotlight-semantic-indexing-readiness", "markdown": "https://wpnews.pro/news/check-macos-spotlight-semantic-indexing-readiness.md", "text": "https://wpnews.pro/news/check-macos-spotlight-semantic-indexing-readiness.txt", "jsonld": "https://wpnews.pro/news/check-macos-spotlight-semantic-indexing-readiness.jsonld"}}