| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.dao.HomeNoticeDao; |
| | | import com.yeshi.buwan.dao.juhe.youku.InternetSearchVideoDao; |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | |
| | | |
| | | @Test |
| | | public void search() { |
| | | String key = "大唐狄公案"; |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setKey(key); |
| | | filter.setContentType(1); |
| | | |
| | | SolrResultDTO internetSearchResultDTO = solrInternetSearchVideoDataManager.find(filter, 1, 10); |
| | | } |
| | | |
| | | |
| | |
| | | System.out.println(solrAlbumVideo); |
| | | } |
| | | |
| | | @Test |
| | | public void syncInternetSearch(){ |
| | | solrInternetSearchVideoDataManager.syncAllAlbum(); |
| | | } |
| | | |
| | | @Resource |
| | | private InternetSearchVideoDao internetSearchVideoDao; |
| | | |
| | | @Test |
| | | public void updateTag(){ |
| | | Query query=new Query(); |
| | | query.addCriteria(Criteria.where("tag").is("评分:null")); |
| | | List<InternetSearchVideo> list = internetSearchVideoDao.findList(query); |
| | | for(InternetSearchVideo video:list){ |
| | | InternetSearchVideo update=new InternetSearchVideo(); |
| | | update.setTag("评分:9.0"); |
| | | update.setId(video.getId()); |
| | | internetSearchVideoDao.updateSelective(update); |
| | | } |
| | | System.out.println(list); |
| | | } |
| | | |
| | | } |