I have had a to get child items in a tree where their name contains a value. This was working until I updated the node (and its templates) to be a bucket. Now I can't get the query to return anything.
I have the item with item name "myItem-123" in the bucket. Typing "123" in the bucket search in the client UI returns the item just fine. "clients" is the bucket in the tree.
var getItemBuilder = new GetItemByPathBuilder()
.Path("/sitecore/content/Client Content/Global/Settings/clients//*")
.AddParam($"123");
var clientSetting = this.contentRepository.GetItem<IMyInterface>(getItemBuilder.Options);
I can use this XPath in XPath builder and it returns the time (I have to use the full name but even with the full name in the addparam call I still get nothing).
I had this all setup and working before I changed it to an item bucket. Not sure how the item bucket change would have broken this. Am I not understand the "AddParam" method correctly?
I have tried a number of GetItems method and GetItemsOptions that match other queries I have done and all those fail as well. It seems whatever I try to query items in a bucket fails.
var getItems2 = new GetItemsByQueryOptions(new Query("/sitecore/content/Client Content/Global/Settings/clients/*"));
var test2 = this.contentRepository.GetItems<IClientViewTemplate>(getItems2);
This also errors out saying the operation is not supported
My mapping looks like this.
this.Map(
config =>
{
config.AutoMap();
config.TemplateId("MyTemplateGUId");
config.EnforceTemplateAndBase();
config.Field(x => x.ViewTemplate).FieldId("MyFieldGUID");
});