Is there a reason why you give a Empty string as the culture? If not, try doing the search without the string.Empty. var v = Umbraco.ContentQuery.Search("my content name");
var easySearch = Umbraco.ContentQuery.Search("Products", "ExternalIndex");
Which means you are passing in the string "ExternalIndex" to the culture parameter.
Your options are to change your method call to one of these:
var easySearch = Umbraco.ContentQuery.Search("Products"); - which by default will query the ExternalIndex
var easySearch = Umbraco.ContentQuery.Search("Products", indexName: "ExternalIndex"); - to explicitly pass the string "Externalndex" to the right parameter
var easySearch = Umbraco.ContentQuery.Search("Products", null, "ExternalIndex"); - to pass all parameter values in the correct order
Using Content Query
Hi,
Im trying to use Umbraco.ContentQuery in a controller to search for content by name but nothing is returned, is what I have below still valid?
var v = Umbraco.ContentQuery.Search("my content name", string.Empty); thanks
Hi,
Is there a reason why you give a Empty string as the culture? If not, try doing the search without the string.Empty.
var v = Umbraco.ContentQuery.Search("my content name");
-Joep
Hello Damio,
I umbraco v8, you should try this.
The syntax you are using is
Which means you are passing in the string "ExternalIndex" to the culture parameter.
Your options are to change your method call to one of these:
var easySearch = Umbraco.ContentQuery.Search("Products");
- which by default will query the ExternalIndexvar easySearch = Umbraco.ContentQuery.Search("Products", indexName: "ExternalIndex");
- to explicitly pass the string "Externalndex" to the right parametervar easySearch = Umbraco.ContentQuery.Search("Products", null, "ExternalIndex");
- to pass all parameter values in the correct orderhttps://github.com/umbraco/Umbraco-CMS/issues/5789
is working on a reply...