summaryrefslogtreecommitdiff
path: root/src/index.py
diff options
context:
space:
mode:
authorKristofer Hallin <kristofer@sunet.se>2021-10-06 21:48:53 +0200
committerKristofer Hallin <kristofer@sunet.se>2021-10-06 21:48:53 +0200
commit6aafba52d7a3f6f03b85d9df35972eb6564d36ed (patch)
tree36573e8e476dd9238469eea635719c5fee27e6ef /src/index.py
parentba8ec01914aa7d8f122f9a968199ffc04b08ec69 (diff)
Create indexes when creating database, also make it possible to search based on indexes.
Diffstat (limited to 'src/index.py')
-rw-r--r--src/index.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/index.py b/src/index.py
new file mode 100644
index 0000000..7933824
--- /dev/null
+++ b/src/index.py
@@ -0,0 +1,47 @@
+indexes = [
+ {
+ "index": {
+ "fields": [
+ "domain"
+ ]
+ },
+ "name": "domain-json-index",
+ "type": "json"
+ },
+ {
+ "index": {
+ "fields": [
+ "ip"
+ ]
+ },
+ "name": "ip-json-index",
+ "type": "json"
+ },
+ {
+ "index": {
+ "fields": [
+ "port"
+ ]
+ },
+ "name": "port-json-index",
+ "type": "json"
+ },
+ {
+ "index": {
+ "fields": [
+ "asn"
+ ]
+ },
+ "name": "asn-json-index",
+ "type": "json"
+ },
+ {
+ "index": {
+ "fields": [
+ "asn_country_code"
+ ]
+ },
+ "name": "asn-country-code-json-index",
+ "type": "json"
+ }
+]