Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
When recipe blank site used, the search page return error «Search is not configured».
Originally posted by **sergeor** October 31, 2021
**when I try to access the search page, I get the message «Search is not configured».**
I will describe to you exactly what I do
- I am creating a new ASP.NET Core empty project. I add reference to `OrchardCore.Application.Cms.Targets`
- I fill the setup page with the recipe `blank site`
- I'm adding a new Content Type with name `Article`. Add to this, `Title` and `HtmlBody`. Check in Full-text the `Include display text` and `Include body parts`. Also, in HtmlBody check the `Include this element in the index`, `Stored`, `Analyzed`
- I Create a new Content Type with name `Articles` and I add `title` `HtmlBody` and `List or Article`. I also check all the search related fields as above.
- In the Search section in Lucene Indices, add an index with name Search, standardanalyzer, Any Culture and check Article and Articles
- In search settings, the index is Search and the Default searched fields is `Content.ContentItem.FullText`. The Allow Lucene queries in search forms is checked
The Run Lucene Query seems to work well. As I get some results
In security Anonymous role I have give access with check the Query Lucene Search Index and Query Lucene Api
Now when I try to access the search page, I get the message **«Search is not configured».**
After some digging I found in `OrchardCore.Modules\OrchardCore.Lucene\Controllers\SearchController.cs` that the `searchSettings.SearchIndex` is null
Any help?
What I'm doing Wrong
We may want to prevent saving the form data when there is no index created beforehand in this case or display a better error message on the search form.
Discussed in https://github.com/OrchardCMS/OrchardCore/discussions/10600
When recipe
blank site
used, the search page return error «Search is not configured».We may want to prevent saving the form data when there is no index created beforehand in this case or display a better error message on the search form.
See misleading notifications here :
It says the settings have been saved successfully but there is no search index saved.
Is there an issue or not?
The search should work, so it's just adjustments on how we handle the form validations and notifications here.