Beispiel #1
0
        public HotelStaticInfo QueryById(int id, string coreName)
        {
            var hotelStaticInfo  = new HotelStaticInfo();
            var solrQueryResults = SolrApi.Query <HotelSolrModel>("id:" + id, null, coreName);

            foreach (var solrQueryResult in solrQueryResults)
            {
                hotelStaticInfo = JsonHelper.DeserializeJsonToObject <HotelStaticInfo>(solrQueryResult.Value);
            }
            return(hotelStaticInfo);
        }
Beispiel #2
0
 public IList <KeyWordHotel> GetKeyWordHotel(int cityCode)
 {
     return(SolrApi.Query <KeyWordHotel>("citycode:" + cityCode, null, "testsolr2").Select(c => new KeyWordHotel
     {
         HotelId = c.HotelId,
         HotelName = c.HotelName,
         CityName = c.CityName,
         CityCode = c.CityCode,
         AreaName = c.AreaName,
         AreaCode = c.AreaCode,
         BusinessDistrict = c.BusinessDistrict,
         HotelBrandName = c.HotelBrandName,
         HotelBrandCode = c.HotelBrandCode
     }).ToList());
 }
Beispiel #3
0
 public SolrQueryResults <HotelOriginalInfoSolrModel> GetHotelById(string hotelId, QueryOptions op)
 {
     return(SolrApi.Query <HotelOriginalInfoSolrModel>("id:" + hotelId, op, "originalhotel"));
 }
Beispiel #4
0
 public SolrQueryResults <HotelOriginalInfoSolrModel> GetHotelOriginal(string cityCode, QueryOptions op)
 {
     return(SolrApi.Query <HotelOriginalInfoSolrModel>("*:*", op, "originalhotel"));
 }
Beispiel #5
0
 public SolrQueryResults <HotelSimpleInfoSolrModel> GetHotelSimple(string cityCode, QueryOptions op)
 {
     return(SolrApi.Query <HotelSimpleInfoSolrModel>("*:*", op, "hotelsimple"));
 }
Beispiel #6
0
 public void AddHotelsToSolr(List <HotelSolrModel> hotels, string coreName)
 {
     SolrApi.Adds(hotels, coreName);
 }
Beispiel #7
0
 public void AddHotelToSolr(HotelSolrModel hotel, string coreName)
 {
     SolrApi.Add(hotel, coreName);
 }