Olti
01/31/2025, 9:03 AMJemayn
01/31/2025, 9:24 AMcsharp
var criteria = searcher.CreateQuery("content", BooleanOperation.And)
That corresponds to a Lucene query that checks that the __IndexType: content
which is helpful in the external index as you wont find things with indexType: media then.
However in your document approach you have this:
csharp
var criteria = searcher.CreateQuery("media", BooleanOperation.And)
Which corresponds to __IndexType: content
where atleast on the ones I have running using the PdfIndex the indextype field has the value pdf
Also - if you set a breakpoint right after you execute the search then you can see the full lucene search string on your criteria - it is often really helpful for debuggingJemayn
01/31/2025, 9:25 AMOlti
01/31/2025, 9:39 AMCategory: content, LuceneQuery: +(combinedField:alexander~2) +__Published:y +searchablePath:1591 -hideFromInternalSearch:1 -__NodeTypeAlias:usnsitemapxml -__NodeTypeAlias:usnrobotstxt
This query returns the expected results.
2. When I search in Documents (using the PDFIndex), my query looks like this:
Category: media, LuceneQuery: +fileTextContent:konzept~2
However, this query returns 0 results, even though I can find the correct document (Marketing Konzept Hunziker) in Examine Management under the same PDFIndex when I search manually.
Here’s where I’m confused:
- Does the query need additional fields to properly target the PDFIndex? Should I explicitly include something like +__IndexType:pdf, or is that already implied by the query’s Category: media?
- When debugging, how can I verify that the query is actually searching where it should?
Just to clarify, the generated Lucene query for document search looks like this when I log it:
Category: media, LuceneQuery: +fileTextContent:konzept~2
It seems correct, but something is still missing. Any advice or guidance on this would be greatly appreciated!
https://cdn.discordapp.com/attachments/1334810683426209842/1334820235957637142/image.png?ex=679debb8&is=679c9a38&hm=1fba9a0b31270f2432b9845851e9ecf3f00e9bea3850337cfc4ca2cc7174189a&Jemayn
01/31/2025, 9:48 AMvar criteria = searcher.CreateQuery("media", BooleanOperation.And)
you make a mistake, it should instead be var criteria = searcher.CreateQuery("pdf", BooleanOperation.And)
.
The code you have now adds a filter to the __IndexType which has 0 results as all índexed pdfs by default will have IndexType: pdf not mediaOlti
01/31/2025, 9:55 AM