Created
March 2, 2012 07:23
-
-
Save ja1984/1956460 to your computer and use it in GitHub Desktop.
Hotdeals ravendb
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 HotDeals_Search : AbstractIndexCreationTask<Cruise, RavenHotDeal> | |
{ | |
public HotDeals_Search() | |
{ | |
Map = docs => from doc in docs | |
from sailDate in doc.ItinerarySailDates.DefaultIfEmpty() | |
where sailDate.Prices.Count() > 0 | |
select new | |
{ | |
doc.Description, | |
doc.Brand, | |
doc.Currency, | |
doc.Nights, | |
doc.ShipCode, | |
sailDate.SailDate, | |
doc.GeoCode, | |
doc.PortCode, | |
doc.PackageCode, | |
doc.SortPrice, | |
doc.SortPrice1Passenger, | |
doc.SortPrice2Passenger, | |
doc.SortPrice3Passenger, | |
doc.SortPrice4Passenger, | |
//ItinerarySailDate = sailDate | |
}; | |
Store(x => x.PackageCode, FieldStorage.Yes); | |
Store(x => x.GeoCode, FieldStorage.Yes); | |
Store(x => x.Nights, FieldStorage.Yes); | |
Store(x => x.PortCode, FieldStorage.Yes); | |
Store(x => x.SailDate, FieldStorage.Yes); | |
Store(x => x.ShipCode, FieldStorage.Yes); | |
Store(x => x.SortPrice1Passenger, FieldStorage.Yes); | |
Store(x => x.SortPrice2Passenger, FieldStorage.Yes); | |
Store(x => x.SortPrice3Passenger, FieldStorage.Yes); | |
Store(x => x.SortPrice4Passenger, FieldStorage.Yes); | |
Sort(x => x.Nights, global::Raven.Abstractions.Indexing.SortOptions.Int); | |
Sort(x => x.SortPrice1Passenger, global::Raven.Abstractions.Indexing.SortOptions.Int); | |
Sort(x => x.SortPrice2Passenger, global::Raven.Abstractions.Indexing.SortOptions.Int); | |
Sort(x => x.SortPrice3Passenger, global::Raven.Abstractions.Indexing.SortOptions.Int); | |
Sort(x => x.SortPrice4Passenger, global::Raven.Abstractions.Indexing.SortOptions.Int); | |
} | |
} | |
public class RavenHotDeal | |
{ | |
public string Description { get; set; } | |
public int Brand { get; set; } | |
public string Currency { get; set; } | |
public int Nights { get; set; } | |
public string ShipCode { get; set; } | |
public DateTime SailDate { get; set; } | |
public string GeoCode { get; set; } | |
public string PortCode { get; set; } | |
public string PackageCode { get; set; } | |
public ItinerarySailDate ItinerarySailDate { get; set; } | |
public decimal SingleTravelerFromPrice { get; set; } | |
public decimal SortPrice1Passenger { get; set; } | |
public decimal SortPrice2Passenger { get; set; } | |
public decimal SortPrice3Passenger { get; set; } | |
public decimal SortPrice4Passenger { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment