Created
May 5, 2012 13:44
-
-
Save felipeleusin/2602559 to your computer and use it in GitHub Desktop.
Raven MoreLikeThis Not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserProfile | |
{ | |
public string Id { get; set; } | |
public string Name { get; set; } | |
public string Hometown { get; set; } | |
public DateTime FromDate { get; set; } | |
public DateTime ToDate { get; set; } | |
public string Neighbourhood { get; set; } | |
public string TravellingWith { get; set; } | |
public List<string> Interests { get; set; } | |
public UserProfile() | |
{ | |
Interests = new List<string>(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserProfileIndex : AbstractIndexCreationTask<UserProfile> | |
{ | |
public UserProfileIndex() | |
{ | |
Map = profiles => from profile in profiles | |
select new | |
{ | |
profile.ToDate, | |
profile.FromDate, | |
profile.Hometown, | |
profile.Neighbourhood, | |
profile.TravellingWith, | |
profile.Interests | |
}; | |
Stores = new Dictionary<Expression<Func<UserProfile, object>>, FieldStorage>() | |
{ | |
{ | |
x => x.ToDate, FieldStorage.Yes | |
}, | |
{ | |
x => x.FromDate, FieldStorage.Yes | |
}, | |
{ | |
x => x.Hometown, FieldStorage.Yes | |
}, | |
{ | |
x => x.Neighbourhood, FieldStorage.Yes | |
}, | |
{ | |
x => x.TravellingWith, FieldStorage.Yes | |
}, | |
{ | |
x => x.Interests, FieldStorage.Yes | |
} | |
}; | |
Index(x => x.ToDate, FieldIndexing.Analyzed); | |
Index(x => x.FromDate, FieldIndexing.Analyzed); | |
Index(x => x.Hometown, FieldIndexing.Analyzed); | |
Index(x => x.Neighbourhood, FieldIndexing.Analyzed); | |
Index(x => x.TravellingWith, FieldIndexing.Analyzed); | |
Index(x => x.Interests, FieldIndexing.Analyzed); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment