Exemplo n.º 1
0
        protected virtual string SetEmptyFieldValue(ContentSearchPortlet.EmptyQueryTermHandler mode, Field field)
        {
            if (mode == ContentSearchPortlet.EmptyQueryTermHandler.ReplaceToWildcard)
            {
                if (field is DateTimeField)
                {
                    return(string.Format("{{{0} TO {1}}}", DateTime.MinValue, DateTime.MaxValue));
                }
                if (field is IntegerField)
                {
                    return(string.Format("{{{0} TO {1}}}", int.MinValue, int.MaxValue));
                }
                return("*");
            }

            if (mode == ContentSearchPortlet.EmptyQueryTermHandler.RemoveEmpty)
            {
                return(ContentQuery.EmptyText);
            }

            return(string.Empty);
        }
Exemplo n.º 2
0
 public DefaultQueryBuilder(string originalQuery, Content searchForm, ContentSearchPortlet.EmptyQueryTermHandler emptyTerm)
 {
     _originalQuery    = originalQuery;
     _searchForm       = searchForm;
     _emptyTermHandler = emptyTerm;
 }
Exemplo n.º 3
0
 public DefaultQueryBuilder(string originalQuery, Content searchForm,ContentSearchPortlet.EmptyQueryTermHandler emptyTerm)
 {
     _originalQuery = originalQuery;
     _searchForm = searchForm;
     _emptyTermHandler = emptyTerm;
 }