Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Henrik Ladefoged 30 posts 100 karma points
    Feb 08, 2016 @ 13:45
    Henrik Ladefoged

    Examine: Searchindex returns no results despite containing 504 documents

    <add name="PDFIndexer" type="UmbracoExamine.PDF.PDFIndexer, UmbracoExamine.PDF" extensions=".pdf" umbracoFileProperty="File"/>

    I got a pdf specific index up and running but no matter what i search for it return " ".

    I tried rebuilding the index several times to no avail.

    My xslt code:

    <xsl:variable name="pdfresult" select="Examine:SearchContentOnly($searchTerm,true(),'PDFSearcher')" />
  • Chriztian Steinmeier 2732 posts 8341 karma points MVP 5x admin c-trib
    Feb 08, 2016 @ 13:49
    Chriztian Steinmeier

    Hi Henrik,

    I haven't tried any Examine stuff, but I noticed thath you named the index PDFIndexer, yet the name you're passing into the extension is PDFSearcher ?

    (I could be missing a mapping somewhere - just wanted to point it out, though).


  • Henrik Ladefoged 30 posts 100 karma points
    Feb 08, 2016 @ 13:56
    Henrik Ladefoged

    Hi Chriztian

    Changing from search to indexer returns the following error:

    System.NotSupportedException: XSLT Extensions are only support for providers of type LuceneSearcher 
    at UmbracoExamine.XsltExtensions.EnsureProvider(BaseSearchProvider p) 
    at UmbracoExamine.XsltExtensions.Search(String searchText, Boolean useWildcards, String providerName, String indexType)

    The complete xslt code for reference:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;">
      exclude-result-prefixes="msxml Examine umb search">
      <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
      <xsl:param name="currentPage"/>
      <xsl:variable name="searchTerm" select="umb:Request('s')" /> 
      <xsl:variable name="result" select="search:Search($searchTerm,'bodyText,header,teaser,metaTitle,metaDescription','BorneraadetContentIndexer','wildcard','1.0')" />
      <xsl:variable name="pdfresult" select="Examine:SearchContentOnly($searchTerm,true(),'PDFIndexer')" />
      <xsl:key name="document-by-id" match="*[@isDoc]" use="@id" />
     <xsl:template match="/">
        <textarea><xsl:copy-of select="$pdfresult" /></textarea>
        <xsl:apply-templates select="$currentPage" />
      <xsl:template match="BorneraadetSearchResult">
        <article class="search-result">
          <h1><xsl:value-of select="header" /></h1>
          <xsl:if test="normalize-space(teaser)">
              <xsl:value-of select="umb:ReplaceLineBreaks(teaser)" disable-output-escaping="yes" />
          <xsl:value-of select="umb:RenderMacroContent(bodyText, @id)" disable-output-escaping="yes" />
          <xsl:apply-templates select="$result" mode="result" />
      <xsl:template match="Results[normalize-space(Result)]" mode="result">
          Du har søgt på: <strong><xsl:value-of select="umb:Request('s')" /></strong> og det gav <strong><xsl:value-of select="count(Result)" /></strong> resultat(er)
        <ul class="searchResult">
          <xsl:apply-templates select="Result" />
      <xsl:template match="Results[not(normalize-space(Result))]" mode="result">
          Du har søgt på: <strong><xsl:value-of select="umb:Request('s')" /></strong> og det gav <strong>ingen</strong> resultater
      <xsl:template match="Result">
        <xsl:variable name="content">
            <xsl:when test="normalize-space(Field[@Name='teaser'])">
              <xsl:value-of select="Field[@Name='teaser']" />
              <xsl:value-of select="Field[@Name='bodyText']" />
        <em class="searchdate"><xsl:value-of select="umb:FormatDateTime(Field[@Name='updateDate'], 'd. MMMM, yyyy')" /></em>
          <a href="{umb:NiceUrl(@Id)}">
              <xsl:when test="normalize-space(Field[@Name='header'])">
                <strong><xsl:value-of select="Field[@Name='header']" /></strong>
                <strong><xsl:value-of select="Field[@Name='nodeName']" /></strong>
            <xsl:value-of select="normalize-space(umb:TruncateString(umb:Replace($content, '&nbsp;', ''), 205, '&#8230;'))" />
  • Ismail Mayat 4511 posts 10061 karma points MVP 2x admin c-trib
    Feb 08, 2016 @ 14:13
    Ismail Mayat

    To search you need PDFSearcher not indexer that is used during indexing time. I am assuming you have written your own xslt extension under Illumi.Search which is what you are calling? If so can you put debugger using visual studio on method SearchContentOnly then can you paste back actual lucene query generated.

    Just to be aware Pdf content lives in field called FileTextContent are you definitely searching on that field?



  • Henrik Ladefoged 30 posts 100 karma points
    Mar 04, 2016 @ 12:26
    Henrik Ladefoged

    Thanks you all for helping.

    Using the "FileTextContent" fieldname solved the problem.


Please Sign in or register to post replies

Write your reply to: