Try our conversational search powered by Generative AI!

SelectMany with string array


Is there a way to make the values of a SelectMany-attributed property be stored as an string array instead of a string?

We have a soultion which uses VulcanSearch and since the value is stored as "string1,string2,string3" it makes the search in those fileds troublesome. Read that for elasticsearch you can fix this by specifying an analyzer for that field that automatically sperates it by comma but I'm not sure how that would be implemented using the Project Vulcan setup.

Sep 23, 2016 17:09

Add another property on contenttype that reads from first and returns a string array...?

Sep 23, 2016 18:20

I think Daniel's suggestion is a viable option, or you could customize the indexing if you don't want to modify your original object:

Sep 24, 2016 19:09

It's amazing how you sometimes don't see the the simple solutions for problems. Thanks for the input! Another property will solve this nicely.

Sep 26, 2016 10:19

Isn't it...? :)

Extension method for the content type is a slightly more elegant way of doing the same if you don't want to mess with your model btw. 

Sep 26, 2016 11:02

Yes that would probably be a better, I just have to figure out how to set that up with Vulcan.

Sep 26, 2016 11:25

Solved it for now using the following setup (adding a property on the page object):

            GroupName = GroupNames.TechnicalInformation,
            Order = 700)]
        [CategorySelectMany("HouseProperties", SelectionFactoryType = typeof(CategorySelectionFactory))]
        public virtual string HousePropertiesString { get; set; }

        public IEnumerable<string> HouseProperties
                var properties = this.GetPropertyValue(p => p.HousePropertiesString);
                if (string.IsNullOrEmpty(properties)) return new List<string>();
                return properties.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
Sep 26, 2016 11:56


You can also add custom fields by implementing an IVulcanIndexingModifier. I've done that to add isSearchable to a page type in a nuget assembly. Here is a sample:

        public void ProcessContent(IContent content, Stream writableStream)
            if (content == null)

            string searchDescription;
            GetDescription(content, out searchDescription);

            // fallback to teaser
            if (string.IsNullOrWhiteSpace(searchDescription) && content is SitePageData)
                searchDescription = ((SitePageData)content).Teaser;

            var streamWriter = new StreamWriter(writableStream);

            if (!string.IsNullOrWhiteSpace(searchDescription))
                streamWriter.Write(",\"" + VulcanFieldConstants.SearchDescriptionField + "\": " + Escape(searchDescription));

            // Add IsSearchable 
            if (content is BlogPostData)
                streamWriter.Write(",\"isSearchable\": true");


Sep 27, 2016 22:25
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.