|
@@ -0,0 +1,76 @@
|
|
1
|
+A search engine for IRC logs. Based on Lucene and Netty. Runs as an HTTP server, exposing REST endpoints for indexing and searching.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+Build and Run
|
|
5
|
+----------
|
|
6
|
+
|
|
7
|
+First install [Apache Maven](http://maven.apache.org). Then execute this command to run the server at port 9090:
|
|
8
|
+
|
|
9
|
+```
|
|
10
|
+mvn package && java -cp target/dependency/*:target/* net.abhinavsarkar.ircsearch.Server 9090
|
|
11
|
+```
|
|
12
|
+
|
|
13
|
+Index chat lines
|
|
14
|
+----------
|
|
15
|
+
|
|
16
|
+<pre>
|
|
17
|
+$ cat ireq | json_pp
|
|
18
|
+{
|
|
19
|
+ "botName" : "some",
|
|
20
|
+ "chatLines" : [
|
|
21
|
+ {
|
|
22
|
+ "timestamp" : 12312312312,
|
|
23
|
+ "user" : "abhinav",
|
|
24
|
+ "message" : "hi"
|
|
25
|
+ },
|
|
26
|
+ {
|
|
27
|
+ "timestamp" : 12312312312,
|
|
28
|
+ "user" : "abhinav",
|
|
29
|
+ "message" : "hi"
|
|
30
|
+ }
|
|
31
|
+ ],
|
|
32
|
+ "channel" : "as",
|
|
33
|
+ "server" : "ima"
|
|
34
|
+}
|
|
35
|
+
|
|
36
|
+$ curl -X POST -d @ireq localhost:9090/index
|
|
37
|
+</pre>
|
|
38
|
+
|
|
39
|
+Search
|
|
40
|
+----------
|
|
41
|
+
|
|
42
|
+<pre>
|
|
43
|
+$ cat sreq | json_pp
|
|
44
|
+{
|
|
45
|
+ "botName" : "some",
|
|
46
|
+ "page" : 0,
|
|
47
|
+ "query" : "hi user:abhinav",
|
|
48
|
+ "channel" : "as",
|
|
49
|
+ "server" : "ima",
|
|
50
|
+ "pageSize" : 10
|
|
51
|
+}
|
|
52
|
+
|
|
53
|
+$ curl -X POST -d @sreq localhost:9090/search -s | json_pp
|
|
54
|
+{
|
|
55
|
+ "page" : 0,
|
|
56
|
+ "query" : "hi user:abhinav",
|
|
57
|
+ "channel" : "as",
|
|
58
|
+ "pageSize" : 10,
|
|
59
|
+ "botName" : "some",
|
|
60
|
+ "chatLines" : [
|
|
61
|
+ {
|
|
62
|
+ "timestamp" : 12312312312,
|
|
63
|
+ "user" : "abhinav",
|
|
64
|
+ "message" : "hi"
|
|
65
|
+ },
|
|
66
|
+ {
|
|
67
|
+ "timestamp" : 12312312312,
|
|
68
|
+ "user" : "abhinav",
|
|
69
|
+ "message" : "hi"
|
|
70
|
+ }
|
|
71
|
+ ],
|
|
72
|
+ "server" : "ima",
|
|
73
|
+ "totalResults" : 24
|
|
74
|
+}
|
|
75
|
+</pre>
|
|
76
|
+
|