Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Organizations_Smart_Search : AbstractIndexCreationTask<Organization, Organizations_Smart_Search.Result>
- {
- public class Result
- {
- public OrganizationStatus Status { get; set; }
- public string OwnerId { get; set; }
- public string[] Query { get; set; }
- }
- public Organizations_Smart_Search()
- {
- Map = organizations => from org in organizations
- select new
- {
- Query = new[]
- {
- org.Name
- },
- org.Status,
- OwnerId = org.Owner.Id
- };
- Index(x => x.Query, FieldIndexing.Search);
- Index(x => x.Status, FieldIndexing.Exact);
- Index(x => x.OwnerId, FieldIndexing.Exact);
- }
- }
- and then consume using:
- var res = ses.Query<Organizations_Smart_Search.Result, Organizations_Smart_Search>();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement