Welcome to Sitecore Stack Exchange. I think by default sitecore is doing an exact search of the text entered in the search box (for example test1), if you take a look in the saerch log it will have a query like this:
?q=((((-_group:(66a1aed3af694bcab42171c1e6331a98) *:*) AND (((_content:(test1) OR _name:(test1) OR _displayname:(test1)) AND _path:(110d559fdea542ea9c1c8a5df7e70ef9)) AND _latestversion:(True))) AND _datasource:(sitecore)) AND _latestversion:(1))&start=0&rows=20&fl=*,score&fq=_indexname:(sitecore_master_index)&wt=xml
Unfortunately there is no OOTB way to change the search query unless specifying * in the search box like tes*. One option would be to try to append this * to the text from javascript when sitecore makes the search call, the field is using the js file /sitecore/shell/Controls/BucketList/BucketList.js, you can take a look at the event $('filterBox' + self.clientId).observe('keyup', function () {
.
If you want to change the query from code you would need to change the existing implementation. When performing a search you will see that it is calling /sitecore/shell/Applications/Buckets/Services/Search.ashx
, which is built in the Sitecore.Buckets.Client
dll in the namespace ItemBuckets.Services.Search
.
namespace ItemBuckets.Services
{
/// <summary>Search End Point</summary>
public class Search : SearchHttpTaskAsyncHandler, IRequiresSessionState
{
This class inherits from the SearchHttpTaskAsyncHandler
which has a method that extracts the query from the parameters:
public void ExtractSearchQuery(NameValueCollection parameters)
{
case "fromBucketListField":
if (parameters[index] != "*")
{
this.searchQuery.Add(new SearchStringModel()
{
Type = "text",
Value = parameters[index],
Operation = "must"
});
continue;
}
You would need to built your own implementation of Search.ashx and you can override the path specified in the field code source in Sitecore.Buckets.FieldTypes.BucketList
:
public class BucketList : SearchList
{
protected override string ScriptParameters => string.Format("'{0}'", (object) string.Join("', '", (object) this.ID,
(object) this.ClientID, (object) this.PageNumber, (object) "/sitecore/shell/Applications/Buckets/Services/Search.ashx"
You can take a look at an example of a custom implementation here http://sitecoreexperiences.blogspot.com/2015/08/serving-non-sitecore-data-in-sitecore_51.html