-
Notifications
You must be signed in to change notification settings - Fork 2
/
JsonAPI.txt
154 lines (125 loc) · 5.54 KB
/
JsonAPI.txt
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
= ninuXoo JSON API =
== Search Operations ==
Operation: exactquery
Description: return the search results that match exactly (i.e. performing an
AND between the exact words) <querystring>.
The optional parameter "ip" restricts the search to a given server IP address.
The optional parameter "filetype" restricts the search to a given filetype/extension.
URL: /json.cgi?op=exactquery&q=<querystring>&ip=<IP address>&filetype=<extension>
Operation: orquery
Description: return the search results that match the single exact words in
<querystring>.
The optional parameter "ip" restricts the search to a given server IP address.
The optional parameter "filetype" restricts the search to a given filetype/extension.
URL: /json.cgi?op=orquery&q=<querystring>&ip=<IP address>&filetype=<extension>
Operation: likequery
Description: return search results by performing variations on the words in
<querystring>, limiting to no more than <word limit> words.
The optional parameter "ip" restricts the search to a given server IP address.
The optional parameter "filetype" restricts the search to a given filetype/extension.
URL: /json.cgi?op=likequery&q=<querystring>&words=<word limit>&ip=<IP address>&filetype=<extension>
Operation: query
Description: return search results by applying in order the exactquery, orquery
and likequery operations, trying to retrieve at least <nresults> results.
The optional parameter "ip" restricts the search to a given server IP address.
The optional parameter "filetype" restricts the search to a given filetype/extension.
URL: /json.cgi?op=query&q=<querystring>&nresults=<nresults>&ip=<IP address>&filetype=<extension>
NOTES: nresults default is 200
Operation: whatsnew
Description: return the resources that have been recently discovered, trying to
retrieve at least <nresults> results, but no more than <nresults>
URL: /json.cgi?op=whatsnew&nresults=<nresults>
NOTES: nresults default is 200
Operation: serverlist
Description: return the list of found servers
URL: /json.cgi?op=serverlist
== Search Results Format ==
{
responsen: <response number>,
response: <response description>,
q: <search terms>,
nresults: <number of results>,
nlabels: <number of result labels>,
searchtime: <search time>,
results: [
{
resultlabel: <results label>,
exactresult: <exact result flag>,
nresults: <number of results>,
resourcetrie: {
label: <label>,
rank: <hierarchy rank>,
resources: [
{
uri: <resource URI>,
filename: <file name>,
filetype: <file type>
},
{
uri: <resource URI>,
filename: <file name>,
filetype: <file type>
},
...
],
children: [
{
label: <label>,
rank: <hierarchy rank>,
resources [
...
],
children: [
...
]
},
{
label: <label>,
rank: <hierarchy rank>,
resources {
...
},
children: {
...
}
},
...
]
}
},
{
resultlabel: <results label>,
exactresult: <exact result flag>,
nresults: <number of results>,
resourcetrie: {
...
}
},
...
]
}
response number: 200 -> OK, 400 -> bad request, 418 -> i'm a teapot, 500 -> server error, 501 -> not implemented
response description: textual description of the response
number of result labels: number of set of results found
search time: time, in seconds, needed to perform the search
results label: the search term or terms that yield to the following results
exact result flag: true for "exact" result, false for "or" or "like" result
number of results: number of resources in the "resources" object
label: the (partial) path on the server
hierarchy rank: the level of the trie's hierarchy. The server's IP/hostname has rank = 2, while the protocol (e.g. "smb:") has rank = 1
resource URI: the resource's complete URI
file name: the resource's file name
file type: the resource's file type
== Other Operations ==
Operation: resourcestats
Description: return the total number of resources currently indexed by the search engine
URL: /json.cgi?op=resourcestats
Operation: serverstats
Description: return the total number of servers currently indexed by the search engine
URL: /json.cgi?op=serverstats
== Other Operations Response/Result Format ==
{
responsen: <response number>,
response: <response description>,
result: <result>
}