Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I'm having issues with my search, for some reason when I search I get no results.....
Even tho when I search in back office I get results......
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.Search> @using ContentModels = Umbraco.Web.PublishedModels; @using Umbraco.Examine @{ Layout = "master.cshtml"; var searchQuery = Request.QueryString["q"]; } <div class="contact-clean"> <form action="@Model.Url" method="GET" id="search"> <div class="form-group"> <div class="row"> <div class="col-xs-12 col-sm-8"> <input type="text" class="form-control col-xs-6" placeholder="Search..." name="q" value="@searchQuery" /> </div> <div class="col-xs-12 col-sm-4"> <button class="btn btn-primary">Search <i class="fa fa-search"></i></button> </div> <div class="col-xs-12"> @if (!string.IsNullOrWhiteSpace(searchQuery)) { var results = Umbraco.ContentQuery.Search(searchQuery, string.Empty); long resultCount = results != null && results.Any() ? results.Count() : 0; <div class="searchresults"> <p>We found <strong>@resultCount</strong> result@(resultCount != 1 ? "s" : "") when searching for <strong>@searchQuery</strong></p> @if (resultCount > 0) { <ul> @foreach (var result in results) { <li> <h3><a href="@result.Content.Url">@result.Content.Name</a></h3> <p>@(result.Content.Value<string>("metaDescription"))</p> </li> } </ul> } </div> } </div> </div> </div> </form> </div>
Scratching head
I've also rebuilt my search index but no joy
Thanks
Hi Matt
What if you do a search in Umbraco developers section => examine indexes
Does it work there?
Hi,
Yeap I get the results......
I just cant see anything wrong with the code which was from Pauls demo site.
Any other suggestions? :)
I just checked the Paul's demo on my machine and search works great.
Hmm its weird, I just deleted all my content and re-imported with uSync and it works fine now....
is working on a reply...
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.
Continue discussion
Search showing no results
Hi all,
I'm having issues with my search, for some reason when I search I get no results.....
Even tho when I search in back office I get results......
Scratching head
I've also rebuilt my search index but no joy
Thanks
Hi Matt
What if you do a search in Umbraco developers section => examine indexes
Does it work there?
Hi,
Yeap I get the results......
I just cant see anything wrong with the code which was from Pauls demo site.
Any other suggestions? :)
I just checked the Paul's demo on my machine and search works great.
Hmm its weird, I just deleted all my content and re-imported with uSync and it works fine now....
is working on a reply...
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.