Copied to clipboard

Flag this post as spam?

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


  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jan 08, 2010 @ 19:53
    Nik Wahlberg
    0

    Key was not present... - Examine

    Hi All,

    I have successfully installed Examine on one of my sites and am able to return results just fine. Here's my config:

    <UmbLuceneIndex DefaultIndexSet="NICIndex" EnableDefaultActionHandler="true">
    
        <!-- REQUIRED: MaxResults,IndexPath,SetName -->
        <!-- NOT Required: IndexParentId. If not specified then then all documents are indexed, otherwise only documents as children of the id are indexed -->
        <IndexSet SetName="NICIndex" IndexPath="~/data/indexes1/" MaxResults="100">
          <IndexUmbracoFields>
            <add Name="id" />             <!-- REQUIRED -->
            <add Name="nodeName" />       <!-- REQUIRED -->
            <add Name="updateDate" />
            <add Name="writerName" />
            <add Name="path" />
            <add Name="nodeTypeAlias" />  <!-- REQUIRED -->
          </IndexUmbracoFields>      
          <!-- The User defined fields to be indexed and searched. The UmbracoIndexer has methods to override the fields to be searched. -->
          <IndexUserFields>
            <add Name="contentPageTitle"/>
            <add Name="bodyText"/>
            <add Name="sidebarContent"/>
            <add Name="adDescription"/>
            <add Name="eventDescription"/>
            <add Name="eventPrimaryLocation"/>
            <add Name="departmentDescription"/>
            <add Name="northeastNewsDescription"/>
            <add Name="northeastNewsFile"/>
            <add Name="dailyNewsClipFile"/> 
            <add Name="dailyNewsClipDescription"/>
            <!-- <add Name="Content"/> Policies content
            <add Name="Title"/> Policies title -->
            <add Name="umbracoFile"/>
          </IndexUserFields>
          <!-- IncludeNodeTypes not required. If not specified, the indexer will index ALL document types
          <IncludeNodeTypes>
            <add Name="" />
          </IncludeNodeTypes>-->
          <!-- ExcludeNodeTypes not required. If specified, these node types will not be indexed. -->
          <ExcludeNodeTypes>
            <add Name="Alerts" />
            <add Name="Alert" />
            <add Name="Blank" />
            <add Name="Container" />
            <add Name="EmployeCornerLink" />
            <add Name="Essential" />
            <add Name="HomagepageBox" />
            <add Name="QuickLink" />
            <add Name="Police" />
          </ExcludeNodeTypes>
        </IndexSet>
    
      </UmbLuceneIndex>

    So, I wanted to add one more field to return in order to be able to link to document types that were returned with a media picker on them. I added 'dailyNewsClipFile' but when I try using it, it keeps throwing the error that this Key was not present?? 

    switch (nodeType)
                {
                    case "DailyNewsClip":
                        var mediaId = int.Parse(sr.Fields["dailyNewsClipFile"]);
                        var file = new Media(mediaId);
                        //url = file.Path;
                        break;
                    case "NNArticle":
                        url = "Northeast News";
                        break;
                    default:
                        url = umbraco.library.NiceUrl(sr.Id);
                        break;
                }//end switch statement

    I am obviously missing something. I even tried creating a new path for indexes to "start from scratch" but no luck. 

    Thanks for your suggestions!

    -- Nik

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jan 08, 2010 @ 20:21
    Nik Wahlberg
    1

    Oooops, I was a little trigger happy with the post. Turns out it was in fact returning the key, but empty fields (empty 'dialyNewsClipFile') throw the ley not found error. 

    Thanks,
    Nik

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jan 09, 2010 @ 00:03
    Aaron Powell
    0

    Glad to see you're using Examine and liking it. I know Shan is working very hard on it at the moment and will have a new drop coming soon. He's working on some new features which better handle clustered/ load balanced environments too :)

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jan 09, 2010 @ 14:31
    Nik Wahlberg
    0

    Sweet, glad to hear that. I know the plan is to have it as part of the 4.1 release which is great. I wish I could find some examples of PDF, and other document indexing for Examine. Does anyone know or care to share their implementation? 

    Thanks,
    Nik

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jan 09, 2010 @ 14:31
    Nik Wahlberg
    0

    Sweet, glad to hear that. I know the plan is to have it as part of the 4.1 release which is great. I wish I could find some examples of PDF, and other document indexing for Examine. Does anyone know or care to share their implementation? 

    Thanks,
    Nik

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jan 09, 2010 @ 22:53
    Aaron Powell
    0

    I'll ask Shan about it, but I believe you just have to find an indexer for Lucene which deals with PDF's (or any other file extensions). I haven't done a site which we've indexed PDF's though

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jan 11, 2010 @ 19:18
    Nik Wahlberg
    0

    So, this would be something that gets installed on the server and configured outside of Examine in other words? 

     

  • Shannon Deminick 1510 posts 5195 karma points hq
    Jan 12, 2010 @ 04:27
    Shannon Deminick
    0

    As for PDF indexing (word indexing, etc...) This won't be built into Examine directly but Examine is hugely flexible with it's API. I'm not sure what version of Examine you are using but the latest version in the repository handles indexing media as well as content. If you want to index you're PDF info, then you can just attach to one of the Examine events, or create your own indexing provider (events are easier though). With events you can also add additional information to an index for a particular node. For instance you might want to bundle the information for some child nodes into the index for the parent node. Using the Examine events, this is fairly easy. I'm sorry i've been a bit slack with the documentation but I promise I'll have a full documentation suite available in the next month or so.

    For examples of events, indexing, searching, config, etc... check out the latest repository check in and see the source code in the test usercontrols.

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jan 12, 2010 @ 19:08
    Nik Wahlberg
    0

    Cool, thanks Shannon, I appreciate the direction and will get the latest and give it a whirl. 

    Cheers,
    Nik

  • Tom 713 posts 952 karma points
    Jan 21, 2010 @ 03:16
    Tom
    0

    Hi guys just wondering if someone had an example of using something like pdfbox and examine?

  • Chris Houston 533 posts 977 karma points MVP admin c-trib
    Jan 22, 2010 @ 16:50
    Chris Houston
    0

    Hi All,

    I am also about to build a client site that will have approximately 3,000 PDF's on launch and hence needs some form of indexing!

    Have any of you managed to implement PDF indexing using Examine or Lucene?

    Cheers,

    Chris

  • Chris Koiak 700 posts 2626 karma points
    Apr 13, 2010 @ 13:26
    Chris Koiak
    0

    Chris, Did you manage to find an example of PDF Indexing with Examine?

    We are currently developing a similar solution and this would be extremely useful.

    Thanks,

    Chris

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies