Search in sources :

Example 1 with Tutorial

use of com.tangtang.elasticsearchexample.domain.Tutorial in project benchmark by seelunzi.

the class TestContreller method testSaveArticleIndex.

@RequestMapping("/add")
public void testSaveArticleIndex() {
    Author author = new Author();
    author.setId(1L);
    author.setName("tianshouzhi");
    author.setRemark("java developer");
    Tutorial tutorial = new Tutorial();
    tutorial.setId(1L);
    tutorial.setName("elastic search");
    Article article = new Article();
    article.setId(1L);
    article.setTitle("springboot integreate elasticsearch");
    article.setAbstracts("springboot integreate elasticsearch is very easy");
    article.setTutorial(tutorial);
    article.setAuthor(author);
    article.setContent("elasticsearch based on lucene," + "spring-data-elastichsearch based on elaticsearch" + ",this tutorial tell you how to integrete springboot with spring-data-elasticsearch");
    article.setPostTime(new Date());
    article.setClickCount(1L);
    articleSearchRepository.save(article);
}
Also used : Tutorial(com.tangtang.elasticsearchexample.domain.Tutorial) Article(com.tangtang.elasticsearchexample.domain.Article) Author(com.tangtang.elasticsearchexample.domain.Author) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Article (com.tangtang.elasticsearchexample.domain.Article)1 Author (com.tangtang.elasticsearchexample.domain.Author)1 Tutorial (com.tangtang.elasticsearchexample.domain.Tutorial)1 Date (java.util.Date)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1