Back to SharePoint Tools

GitHub Search Query Tool for SharePoint Online

By Nagendra JayaramSeptember 15, 20258 min read

About the GitHub Search Query Tool

The GitHub Search Query Tool is an enhanced version of SharePoint's native search tool that provides comprehensive KQL testing and debugging capabilities. This community-maintained tool offers advanced features for testing search functionality, debugging query issues, and analyzing search behavior in SharePoint Online environments. It includes better error handling, enhanced result visualization, and additional debugging options not available in the standard SharePoint tool. The tool is actively maintained and regularly updated with new features based on community feedback.

Access the Tool

GitHub Repository: SharePoint Search Query Tool

Download and host locally or use the web-based version for immediate testing.

Key Features and Capabilities

Installation and Setup

  1. Download from GitHub: Clone or download the repository from the official GitHub location
  2. Host Locally: Deploy to your SharePoint environment or host on a local web server
  3. Configure Permissions: Ensure the tool has appropriate permissions to access search APIs
  4. Test Connection: Verify connectivity to your SharePoint Online tenant

Basic Usage Examples

# Search for documents in a specific library ContentClass:STS_ListItem_DocumentLibrary # Find content by specific author Author:"John Smith" AND ContentClass:STS_ListItem_DocumentLibrary # Search for recently modified documents LastModifiedTime>=2025-09-01 AND FileExtension:pdf # Find pages in specific site collections Path:"https://contoso.sharepoint.com/sites/marketing*" AND ContentClass:STS_Web # Search by content type ContentTypeId:0x0101* AND Title:budget # Complex query with multiple conditions (FileExtension:xlsx OR FileExtension:pdf) AND Author:"Jane Doe" AND LastModifiedTime>=2025-09-01

Advanced Query Techniques

Property-Based Searches

# Search specific managed properties Title:budget AND Department:Finance # Use wildcards for partial matches Author:John* AND FileExtension:doc* # Range queries for dates and numbers LastModifiedTime:[2025-09-01..2025-09-15] Size:[1000000..5000000] # Boolean operations (Title:budget OR Title:financial) AND -Author:external

Site and Location Targeting

# Target specific sites Site:https://contoso.sharepoint.com/sites/marketing # Search within site collections SiteCollection:https://contoso.sharepoint.com/sites/finance # List-specific searches ListId:"{12345678-1234-1234-1234-123456789012}" # Web-specific content WebId:"{87654321-4321-4321-4321-210987654321}"

Debugging and Troubleshooting

Common Query Issues

Query Optimization Tips

# Use specific properties instead of general text search Title:budget (instead of just "budget") # Combine filters to narrow results Author:"John Smith" AND LastModifiedTime>=2025-09-01 AND ContentClass:STS_ListItem_DocumentLibrary # Use exact paths for better performance Path:"https://contoso.sharepoint.com/sites/finance/documents*" # Limit results for testing (Your query here) AND RowLimit:50

Best Practices

Query Development

  • Start Simple: Begin with basic queries and gradually add complexity
  • Test Incrementally: Add one filter at a time to understand impact
  • Use Specific Properties: Target exact managed properties rather than full-text search
  • Document Queries: Save successful queries for reuse and documentation

Performance Optimization

  • Limit Scope: Use Path or Site properties to narrow search scope
  • Use Filters: Apply ContentClass and other filters to reduce result set
  • Avoid Wildcards: Minimize use of wildcard characters in queries
  • Set Row Limits: Use RowLimit property for testing and development

Security Considerations

  • Test Permissions: Verify queries respect security trimming
  • Use Service Accounts: Use dedicated accounts for automated queries
  • Audit Query Usage: Monitor and log query execution for compliance
  • Protect Sensitive Data: Ensure queries don't expose confidential information

Integration with SharePoint Administration

Search Configuration Testing

Use the tool to validate search configurations:

Content Analysis

# Analyze content distribution ContentClass:STS_ListItem_DocumentLibrary AND FileExtension:pdf # Check indexing completeness LastModifiedTime>=2025-09-14 AND ContentClass:STS_ListItem_DocumentLibrary # Verify metadata extraction Author:* AND Department:* AND Title:* # Test multilingual content Language:1033 OR Language:1036

Troubleshooting Common Scenarios

Search Not Finding Recent Content

  1. Check if content is within crawl scope
  2. Verify LastModifiedTime properties
  3. Test with specific document URLs
  4. Check for permission issues

Query Performance Issues

  1. Analyze query complexity and filters
  2. Check for inefficient wildcard usage
  3. Verify result source configurations
  4. Monitor query execution time

Unexpected Results

  1. Review managed property mappings
  2. Check for query rule interference
  3. Verify security trimming behavior
  4. Analyze relevance scoring factors

About the Author: Nagendra Jayaram is a Microsoft Sr Technical Advisor with 18+ years of enterprise experience specializing in SharePoint Online search architecture and administration.