Skip to content

Commit

Permalink
[nasuf]update sending email with mongo query result
Browse files Browse the repository at this point in the history
  • Loading branch information
nasuf committed May 14, 2016
1 parent f846b86 commit 1e4bdda
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 19 deletions.
49 changes: 32 additions & 17 deletions kindlepocket-cms/pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kindlepocket.cms</groupId>
<artifactId>kindlepocket-cms</artifactId>
<version>0.0.1-SNAPSHOT</version>

<parent>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kindlepocket.cms</groupId>
<artifactId>kindlepocket-cms</artifactId>
<version>0.0.1-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
Expand All @@ -16,18 +17,15 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- <dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb2</artifactId>
<version>1.9.1.RELEASE</version>
</dependency> -->
<!-- <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb2</artifactId>
<version>1.9.1.RELEASE</version> </dependency> -->

<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>4.10.1</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -39,19 +37,36 @@
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.1</version>
</dependency>

<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>

</dependencies>


</project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.kindlepocket.cms.pojo;

import org.apache.solr.client.solrj.beans.Field;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

// ignore unknown fields
@JsonIgnoreProperties(ignoreUnknown = true)
@Document
public class Item {

@Id
@Field("id")
private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public class TextBookSearchService {
public void testAddData() {
HttpSolrServer solrServer = new HttpSolrServer("http://localhost:8983/kindlePocket");
List<Item> items = new ArrayList<Item>();
for (int i = 1; i <= 200; i++) {
for (int i = 400; i <= 450; i++) {
Item item = new Item();
item.setDownloadTimes(new Date().getTime());
item.setAuthor("nasuf_" + i);
item.setId((long) i);
item.setKindleMailTimes((long) i);
item.setMailTimes((long) i);
item.setTitle("nasuf's No." + i);
item.setTitle("ephemeris_No." + i);
item.setUploadDate(new Date().getTime());
item.setUploaderName("nasuf_" + i);
items.add(item);
Expand Down Expand Up @@ -81,6 +81,7 @@ public SearchResult search(String keyWords, Integer page, Integer rows) throws E
// whether need highlight
boolean isHighlighting = !StringUtils.equals("*", keyWords) && StringUtils.isNotEmpty(keyWords);

isHighlighting = false;
if (isHighlighting) {
// highlight config
// enable highlight
Expand Down

0 comments on commit 1e4bdda

Please sign in to comment.