Hey everyone,
I'm implementing a PDF search using Examine in Umbraco 13, and everything is working except for filtering by path.
What Works ✅
- Searching for text inside PDFs works using fileTextContent.
- Searching by nodeName also works.
- If I don't filter by path, I get results.
What Doesn't Work ❌
- When I try to filter by path, I get zero results.
- The same query works in Examine Management but not in my code.
How My Examine Data Looks:
In Examine Management, when I search for a PDF, I see this in the index:
path: -1,1600,1603,1611,2227
__IndexType: pdf
nodeName: Marketing Document
fileTextContent: "This document contains marketing strategies..."
- 1603 is my media root folder (selected by the user).
- 2227 is the actual PDF file inside /HQM/blog1/.
Lucene Query That Works in Examine Management
If I manually search in Examine Management with:
fileTextContent:marketing~2 OR nodeName:marketing~2
I get results.
Lucene Query That My Code Generates (Fails)
Here’s what my code generates:
Lucene Query: { Category: pdf, LuceneQuery: +(fileTextContent:marketing~2 nodeName:marketing~2) +path:1603* }
This returns zero results ❌, even though 1603* should match -1,1600,1603,1611,2227.