Esempio n. 1
0
        protected virtual void SearchText(ISearchHelper searchHelper, QueryList query)
        {
            if (string.IsNullOrWhiteSpace(Text))
            {
                return;
            }

            string text = Regex.Replace(Text, @"[^\wæøåÆØÅ\-@\. ]", string.Empty).ToLowerInvariant().Trim();

            string[] terms = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            if (terms.Length == 0)
            {
                return;
            }

            // Fallback if no fields are added
            FieldList fields = GetTextFields(searchHelper);

            if (fields == null || fields.Count == 0)
            {
                fields = FieldList.GetFromStringArray(new[] { "nodeName_lci", "contentTeasertext_lci", "contentBody_lci" });
            }

            query.Add(fields.GetQuery(terms));
        }
Esempio n. 2
0
 protected virtual void SearchPath(ISearchHelper searchHelper, QueryList query)
 {
     if (RootIds == null || RootIds.Length == 0)
     {
         return;
     }
     query.Add("(" + string.Join(" OR ", from id in RootIds select "path_search:" + id) + ")");
 }
Esempio n. 3
0
 protected virtual void SearchHideFromSearch(ISearchHelper searchHelper, QueryList query)
 {
     if (DisableHideFromSearch)
     {
         return;
     }
     query.Add("hideFromSearch:0");
 }
        protected virtual void SearchText(ISearchHelper searchHelper, QueryList query)
        {
            if (Text == null)
            {
                return;
            }

            string textQuery = Text.GetRawQuery();

            if (string.IsNullOrWhiteSpace(textQuery))
            {
                return;
            }

            query.Add(textQuery);
        }