#kql 12 articles
"Search finds nothing here" is usually a site missing from the index — not a permissions problem gotchas / search Three queries tell you whether the site is in the index at all, before you debug a query that was never wrong An unparenthesized OR in your KQL query silently escapes the scope filter gotchas / search KQL AND binds tighter than OR; wrapping the query in parens is necessary but NOT sufficient (text can break out of them), and an empty custom path list must not fall back to the whole tenant Duplicate trimming hides exactly the file copies you are searching for gotchas / search Search collapses identical content by default, so a copy-finder returns "no copies" exactly when perfect copies exist; trimduplicates=false on duplicate-hunting queries only Find externally / anonymously shared content via Search snippets / rest Oversharing / Copilot-readiness audit: ViewableByExternalUsers:1 surfaces files shared out, security-trimmed, one query Graph Search returns 0 hits — you passed the user's question as the queryString gotchas / search Translate question→keywords; "what's new" is a listing (* + default date sort, custom sort = 400); per-entity KQL only as documented RAG finds nothing that SharePoint Search finds — the reasoning model spent the whole token cap thinking gotchas / search GPT-5/o-series count hidden reasoning in max_completion_tokens; a small cap on the query-generator call returns empty text (HTTP 200), and a raw-question fallback ANDs every word in KQL Scope SharePoint Search to hundreds or thousands of sites with RefinementFilters — and or() with one value returns nothing gotchas / search To restrict any Search query to an explicit list of site collections, POST to /_api/search/postquery with RefinementFilters SPSiteUrl:or(...) (tested with 3,000 URLs); a single value must use equals() because or() with… Search ignores unknown managed properties — silently gotchas / search A made-up property name returns HTTP 200 with full results; auto-created Choice properties are not queryable; probe with a fake name, map to RefinableString Search queries that actually work guides The one mandatory header, practical KQL, managed properties (RefinableString*), paging/sorting, and the freshness/trimming traps Sensitivity labels in SharePoint Search — the managed property works, but licensing gates it gotchas / search InformationProtectionLabelId returns a GUID only after AIP-enable + label + crawl; unlicensed tenants can't even create a label (InvalidLicenseException) SharePoint Search finds nothing for a question in an inflected language — add prefix-wildcard stems, and never turn zero hits into "latest documents" gotchas / search KQL is implicit AND and matches exact word forms, so Czech inflected forms miss; add a stem* variant in code, relax before giving up, and never serve a date-sorted inventory as sources for a specific question Two KQL restrictions on the same property separated by a space are OR-ed — a range needs AND gotchas / search KQL joins restrictions on the SAME managed property with OR when only a space separates them, so a size or date range written as two restrictions matches every item; write ranges with explicit AND or a..b