Exemplo n.º 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);
        }
Exemplo n.º 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());
 }
Exemplo n.º 3
0
 public SolrQueryResults <HotelOriginalInfoSolrModel> GetHotelById(string hotelId, QueryOptions op)
 {
     return(SolrApi.Query <HotelOriginalInfoSolrModel>("id:" + hotelId, op, "originalhotel"));
 }
Exemplo n.º 4
0
 public SolrQueryResults <HotelOriginalInfoSolrModel> GetHotelOriginal(string cityCode, QueryOptions op)
 {
     return(SolrApi.Query <HotelOriginalInfoSolrModel>("*:*", op, "originalhotel"));
 }
Exemplo n.º 5
0
 public SolrQueryResults <HotelSimpleInfoSolrModel> GetHotelSimple(string cityCode, QueryOptions op)
 {
     return(SolrApi.Query <HotelSimpleInfoSolrModel>("*:*", op, "hotelsimple"));
 }
Exemplo n.º 6
0
 public void AddHotelsToSolr(List <HotelSolrModel> hotels, string coreName)
 {
     SolrApi.Adds(hotels, coreName);
 }
Exemplo n.º 7
0
 public void AddHotelToSolr(HotelSolrModel hotel, string coreName)
 {
     SolrApi.Add(hotel, coreName);
 }