-
Notifications
You must be signed in to change notification settings - Fork 63
/
IndexTest.java
34 lines (27 loc) · 791 Bytes
/
IndexTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package indexing;
import com.github.cleverage.elasticsearch.Index;
import com.github.cleverage.elasticsearch.Indexable;
import com.github.cleverage.elasticsearch.annotations.IndexType;
import java.util.HashMap;
import java.util.Map;
/**
* User: nboire
* Date: 18/05/12
*/
@IndexType(name = "indexTest")
public class IndexTest extends Index {
public String name;
// Find method static for request
public static Finder<IndexTest> find = new Finder<IndexTest>(IndexTest.class);
@Override
public Map toIndex() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("name", name);
return map;
}
@Override
public Indexable fromIndex(Map map) {
this.name = (String) map.get("name");
return this;
}
}