예제 #1
0
        public static Document MapperFunction(Poco obj)
        {
            var doc = new Document();

            //doc.Add(new Field("PropInt", obj.PropInt.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropNullInt", obj.PropNullInt.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropString", obj.PropString, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropDt", LukeMapper.ToDateString(obj.PropDt), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("Int", obj.Int.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("NullInt", obj.NullInt.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("String", obj.String, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("Dt", LukeMapper.ToDateString(obj.Dt), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("NullDt", obj.NullDt.HasValue ? LukeMapper.ToDateString(obj.NullDt.Value) : "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropNullDt", obj.PropNullDt.HasValue ? LukeMapper.ToDateString(obj.PropNullDt.Value) : "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("Char", obj.Char.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropChar", obj.PropChar.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("NullChar", obj.NullChar.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropNullChar", obj.PropNullChar.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("Bl", obj.Bl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            doc.Add(new Field("PropBl", obj.PropBl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("NullBl", obj.NullBl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            doc.Add(new Field("PropNullBl", obj.PropNullBl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            return(doc);
        }
예제 #2
0
        public static Document MapperFunction(Poco obj)
        {
            var doc = new Document();

            //doc.Add(new Field("PropInt", obj.PropInt.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropNullInt", obj.PropNullInt.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropString", obj.PropString, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropDt", LukeMapper.ToDateString(obj.PropDt), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("Int", obj.Int.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("NullInt", obj.NullInt.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("String", obj.String, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("Dt", LukeMapper.ToDateString(obj.Dt), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("NullDt", obj.NullDt.HasValue ? LukeMapper.ToDateString(obj.NullDt.Value) : "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropNullDt", obj.PropNullDt.HasValue ? LukeMapper.ToDateString(obj.PropNullDt.Value) : "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("Char", obj.Char.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropChar", obj.PropChar.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            //doc.Add(new Field("NullChar", obj.NullChar.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            //doc.Add(new Field("PropNullChar", obj.PropNullChar.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("Bl", obj.Bl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            doc.Add(new Field("PropBl", obj.PropBl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            doc.Add(new Field("NullBl", obj.NullBl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
            doc.Add(new Field("PropNullBl", obj.PropNullBl.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));

            return doc;
        }