title: Umbraco Omitting Media files from search results
body: <p>As my title suggests, I am wanting my search code to omit anything in my media folder. Right now, if I search for "test" it will bring back any page with the word test in it as well as any document or image which has test on it as well. </p>
  
  <p>Is there a way I can amend my current search code to do this?</p>
  
  <p>My code looks like this. Please note I have removed my pagination code as it wasn't applicable to my issue:</p>
  
  <pre><code>@{
      Layout = "Master.cshtml";
      @*search variables*@
      var searchTerm = Request["term"];
  
      if (String.IsNullOrEmpty(searchTerm))
      {
          &lt;p&gt;Please use the search box&lt;/p&gt;
          return;
      }
  
  
      @*the searcher instance to use - Umbraco has 3 by default - InternalSearcher, ExternalSearcher and InternalMemberSearcher *@
      var searcher = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"];
      var searchCriteria = searcher.CreateSearchCriteria(BooleanOperation.Or);
      @* define node properties to be searched below *@
      var query = searchCriteria.GroupedOr(new string[] { "pageTitle", "metaDescription", "nodeName", "heading", "bodyText", "summary" }, searchTerm.Fuzzy(0.5f)).Compile();
  
      var searchResults = searcher.Search(query);
      var resultPage = searchResults.Skip(currentPage * itemsPerPage).Take(itemsPerPage);
      var noResults = searchResults.Count();
      var numberOfPages = Math.Ceiling((decimal)((noResults - 1) / itemsPerPage)) + 1;
      var pages = Enumerable.Range(1, (int)numberOfPages);
  }
  
  @Html.Partial("Breadcrumb")
  
  &lt;div class="container content"&gt;
      &lt;h3&gt;You searched for &lt;b&gt;@searchTerm&lt;/b&gt;, we found @noResults results&lt;/h3&gt;
  
      &lt;ul class="row clearfix list-unstyled newslist"&gt;
          @foreach (var result in resultPage)
          {
              &lt;li class="col-md-12 column"&gt;
                  &lt;div class="row clearfix"&gt;
                      &lt;div class="col-md-12 column"&gt;
  
                          &lt;h2&gt;
                              @if (result.Fields.ContainsKey("pageTitle"))
                              {
                                  &lt;a href="@umbraco.library.NiceUrl(result.Id)"&gt;@result.Fields["pageTitle"]&lt;/a&gt;
                              }
                              else
                              {
                                  &lt;a href="@umbraco.library.NiceUrl(result.Id)"&gt;@result.Fields["nodeName"]&lt;/a&gt;
                              }
  
                          &lt;/h2&gt;
  
                          @if (result.Fields.ContainsKey("metaDescription"))
                          {
                              &lt;p&gt;
                                  @result.Fields["metaDescription"]
                              &lt;/p&gt;
                          }
  
                          @if (result.Fields.ContainsKey("summary"))
                          {
  
                              &lt;p&gt;
                                  @result.Fields["summary"]
  
                              &lt;/p&gt;
                          }
  
                          @*@foreach(var fieldItem in result.Fields)
                              {
                                  &lt;p&gt;@fieldItem.Key &lt;b&gt;: &lt;/b&gt; @fieldItem.Value&lt;/p&gt;
                              }*@
  
                          &lt;p class="pull-left"&gt;
                          &lt;/p&gt;&lt;div class="addthis_sharing_toolbox"&gt;&lt;/div&gt;
                          &lt;p&gt;&lt;/p&gt;
  
                          &lt;p class="pull-right"&gt;
                              &lt;a class="btn btn-green" href="@umbraco.library.NiceUrl(result.Id)"&gt;View details »&lt;/a&gt;
                          &lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
          }
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>