Search in sources :

Example 26 with PostDoc

use of com.nixmash.blog.solr.model.PostDoc in project nixmash-blog by mintster.

the class SolrTestUtils method createPostDoc.

protected static PostDoc createPostDoc(int id) {
    PostDoc postDoc = new PostDoc();
    postDoc.setPostId(Integer.toString(id));
    postDoc.setPostTitle("Post Title " + id);
    postDoc.setPostAuthor("mintster");
    postDoc.setPostName("post-title-" + id);
    postDoc.setPostLink(id % 2 == 0 ? "" : "http://somewhere/" + id);
    postDoc.setPostType(id % 2 == 0 ? "POST" : "LINK");
    postDoc.setPostHTML("<strong>Post HTML</strong> " + id);
    postDoc.setPostText("Post Content " + id);
    postDoc.setPostSource(id % 2 == 0 ? "somewhere.com" : "NA");
    postDoc.setTags(tags);
    postDoc.setDocType(SolrDocType.POST);
    return postDoc;
}
Also used : PostDoc(com.nixmash.blog.solr.model.PostDoc)

Aggregations

PostDoc (com.nixmash.blog.solr.model.PostDoc)26 Test (org.junit.Test)13 Post (com.nixmash.blog.jpa.model.Post)8 Query (org.springframework.data.solr.core.query.Query)8 SimpleQuery (org.springframework.data.solr.core.query.SimpleQuery)8 IPostDoc (com.nixmash.blog.solr.model.IPostDoc)5 PostQueryDTO (com.nixmash.blog.jpa.dto.PostQueryDTO)4 ArrayList (java.util.ArrayList)3 Criteria (org.springframework.data.solr.core.query.Criteria)3 SimpleStringCriteria (org.springframework.data.solr.core.query.SimpleStringCriteria)3 Transactional (org.springframework.transaction.annotation.Transactional)3 PostNotFoundException (com.nixmash.blog.jpa.exceptions.PostNotFoundException)1 JsonRequestMapping (com.nixmash.blog.mvc.annotations.JsonRequestMapping)1 GeoLocationException (com.nixmash.blog.solr.exceptions.GeoLocationException)1 Product (com.nixmash.blog.solr.model.Product)1 MessageFormat (java.text.MessageFormat)1 Ignore (org.junit.Ignore)1 PageRequest (org.springframework.data.domain.PageRequest)1 UncategorizedSolrException (org.springframework.data.solr.UncategorizedSolrException)1 FacetFieldEntry (org.springframework.data.solr.core.query.result.FacetFieldEntry)1