I have added a search field to my site.
When i press search, it only returns a page type of the site outside of the root called Site Settings? Any help gladly accepted as to why my site isnt finding anything else.
I have added the code for the search box:
<form action="/search/" method="GET">
<input type="text" placeholder="Search..." name="query">
<button>Search</button>
</form>
var searchQuery = Request.QueryString["query"];
if (!string.IsNullOrEmpty(searchQuery))
{
<div class="searchresults">
<p>Your search results for <strong>@searchQuery</strong></p>
<ul>
@foreach (var result in Umbraco.Search(searchQuery))
{
<li>
<a href="@result.Url">@result.Name</a>
</li>
}
</ul>
</div>
}
Following this, i added some index criteria to Examine Index .config and ExamineSettings.config.
When i use the search tool in developer area, i get data returned but in here i do not :'(
Hi, Sam,
Umbraco.Search() uses the default "ExternalIndexSet". You mentioned that you made some changes in ExamineIndex and ExamineSettings. Can you share the settings?
Search box
Hi All,
I have added a search field to my site. When i press search, it only returns a page type of the site outside of the root called Site Settings? Any help gladly accepted as to why my site isnt finding anything else.
I have added the code for the search box:
Following this, i added some index criteria to Examine Index .config and ExamineSettings.config.
When i use the search tool in developer area, i get data returned but in here i do not :'(
Many thanks in advance!
Hi, Sam, Do you have a page in your Content tree with link "/search"?
Mila
Hi Mila thank you for replying!
I do have a search page yes. The page produces a list of pages but the only one found is the site settings page.
Sam
Hi, Sam, Umbraco.Search() uses the default "ExternalIndexSet". You mentioned that you made some changes in ExamineIndex and ExamineSettings. Can you share the settings?
Regards Mila
is working on a reply...