Storing JSON array in Lucene Index as FieldStorage

293 views
Skip to first unread message

spokeypokey

unread,
Nov 15, 2011, 7:47:39 PM11/15/11
to rav...@googlegroups.com
I realize why the following code won't work ("Cannot deserialize JSON array into type 'System.String'"), but I'm not sure how to correct this problem
when creating this hierarchical index:


    public class ProviderSearchIndex : AbstractIndexCreationTask<ProviderPto, ProviderSearchIndex.Result>
    {
        public class Result
        {
            public string NetworkName { get; set; }
        }

        public ProviderSearchIndex()
        {
            Map = providerPtos =>
                  from p in providerPtos
                  select new
                             {
                                 NetworkName = p.NetworksPto.Select(n => n.Name),
                             };

            Store(x => x.NetworkName, FieldStorage.Yes);

        }
    }

spokeypokey

unread,
Nov 16, 2011, 12:10:23 AM11/16/11
to rav...@googlegroups.com
After I left work and thought about this condition for a while, I realized that retrieving the network names from the index in this situation really doesn't make much sense. Please forgive my temporary insanity.
Reply all
Reply to author
Forward
0 new messages