private static IClrTypeMapping <PercolatedQuery> PercolatorInferrence(ClrTypeMappingDescriptor <PercolatedQuery> map)
        {
            var typeName = Configuration.ElasticsearchVersion <= new ElasticsearchVersion("5.0.0-alpha1") ? ".percolator" : "query";

            return(map
                   .IndexName("queries")
                   .TypeName(typeName));
        }
Example #2
0
 private static IClrTypeMapping <Project> ProjectMapping(ClrTypeMappingDescriptor <Project> m)
 {
     m.IndexName("project").IdProperty(p => p.Name);
     //*_range type only available since 5.2.0 so we ignore them when running integration tests
     if (VersionUnderTestSatisfiedBy("<5.2.0") && Configuration.RunIntegrationTests)
     {
         m.Ignore(p => p.Ranges);
     }
     return(m);
 }
Example #3
0
 private IClrTypeMapping <Specimen> GetClrMapping(ClrTypeMappingDescriptor <Specimen> mapping) =>
 mapping.IndexName(IndexName)
 .PropertyName(s => s.Id, "id")
 .PropertyName(s => s.Name, "name")
 .PropertyName(s => s.Quantity, "quantity")
 .PropertyName(s => s.InventoryItem, "inventoryItem")
 .PropertyName(s => s.Notes, "notes")
 .PropertyName(s => s.CreatedBy, "createdBy")
 .PropertyName(s => s.ModifiedBy, "modifiedBy")
 .PropertyName(s => s.DateCreated, "dateCreated")
 .PropertyName(s => s.DateModified, "dateModified");
Example #4
0
 private IClrTypeMapping <PlantInfo> GetClrMapping(ClrTypeMappingDescriptor <PlantInfo> mapping) =>
 mapping.IndexName(IndexName)
 .PropertyName(pl => pl.Id, "id")
 .PropertyName(pl => pl.CommonName, "commonName")
 .PropertyName(pl => pl.ScientificName, "scientificName")
 .PropertyName(pl => pl.Preferred, "preferred")
 .PropertyName(pl => pl.BloomTimes, "bloomTimes")
 .PropertyName(pl => pl.MinimumBloomTime, "minBloom")
 .PropertyName(pl => pl.MaximumBloomTime, "maxBloom")
 .PropertyName(pl => pl.MinimumHeight, "minHeight")
 .PropertyName(pl => pl.MaximumHeight, "maxHeight")
 .PropertyName(pl => pl.HeightUnit, "heightUnit")
 .PropertyName(pl => pl.MinimumSpread, "minSpread")
 .PropertyName(pl => pl.MaximumSpread, "maxSpread")
 .PropertyName(pl => pl.SpreadUnit, "spreadUnit")
 .PropertyName(pl => pl.WaterTypes, "waterTypes")
 .PropertyName(pl => pl.MinimumWater, "minWater")
 .PropertyName(pl => pl.MaximumWater, "maxWater")
 .PropertyName(pl => pl.LightTypes, "lightTypes")
 .PropertyName(pl => pl.MinimumLight, "minLight")
 .PropertyName(pl => pl.MaximumLight, "maxLight")
 .PropertyName(pl => pl.StratificationStages, "stratificationStages")
 .PropertyName(pl => pl.WildlifeEffects, "wildlifeEffects")
 .PropertyName(pl => pl.SoilTypes, "soilTypes")
 .PropertyName(pl => pl.Zones, "zones")
 .PropertyName(pl => pl.MinimumZone, "minZone")
 .PropertyName(pl => pl.MaximumZone, "maxZone")
 .PropertyName(pl => pl.Visibility, "visibility")
 .PropertyName(pl => pl.CreatedBy, "createdBy")
 .PropertyName(pl => pl.ModifiedBy, "modifiedBy")
 .PropertyName(pl => pl.DateCreated, "dateCreated")
 .PropertyName(pl => pl.DateModified, "dateModified")
 .PropertyName(pl => pl.Lifeform, "lifeform")
 .PropertyName(pl => pl.Origin, "origin")
 .PropertyName(pl => pl.Taxon, "taxon")
 .PropertyName(pl => pl.User, "user")
 .PropertyName(pl => pl.PlantLocations, "plantLocations")
 .PropertyName(pl => pl.Synonyms, "synonyms");
 public static ClrTypeMappingDescriptor <T> IndexTypeNameInferrer <T>(this ClrTypeMappingDescriptor <T> clr,
                                                                      string additionalSuffix = null) where T : class
 {
     return(clr.IndexName(additionalSuffix + typeof(T).Name.ToLower().Replace("entity", "")));
 }