comparison scripts/test.luan @ 1269:bcb39089e899

remove Ab_testing
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 12 Nov 2018 19:50:37 -0700
parents 0f2890e2ba16
children d410747a671a
comparison
equal deleted inserted replaced
1268:725e52076f03 1269:bcb39089e899
20 local range = Luan.range or error() 20 local range = Luan.range or error()
21 local trim = String.trim or error() 21 local trim = String.trim or error()
22 local find = String.find or error() 22 local find = String.find or error()
23 local init = Http_test.init or error() 23 local init = Http_test.init or error()
24 local get_page = Http_test.get_page or error() 24 local get_page = Http_test.get_page or error()
25 local Ab_testing = require "luan:lucene/Ab_testing.luan"
26 25
27 26
28 local function print(...) 27 local function print(...)
29 Io.print_to(Io.stderr,...) 28 Io.print_to(Io.stderr,...)
30 end 29 end
52 local this_dir = this_file.parent() 51 local this_dir = this_file.parent()
53 local lucene_dir = this_dir.parent().child("build").child("lucene_test") 52 local lucene_dir = this_dir.parent().child("build").child("lucene_test")
54 --print(lucene_dir.to_string()) 53 --print(lucene_dir.to_string())
55 local db = Lucene.index(lucene_dir.to_string()) 54 local db = Lucene.index(lucene_dir.to_string())
56 db.delete_all() 55 db.delete_all()
57
58 local ab_testing = Ab_testing.of(db)
59 local test_events = {"all"}
60 local aggregator_factories = {
61 all = Ab_testing.count_all;
62 }
63 ab_testing.test{ name="All", values={"all"}, events=test_events, aggregator_factories=aggregator_factories }
64 ab_testing.test{ name="null", values={"A","B"}, events=test_events, aggregator_factories=aggregator_factories }
65
66 for record in range(1,10) do
67 local doc = {type="test"}
68 ab_testing.to_doc(doc)
69 db.save(doc)
70 end
71
72 init()
73 ab_testing.web_page{"All","null"}()
74 56
75 local Web_search = require "luan:lucene/Web_search.luan" 57 local Web_search = require "luan:lucene/Web_search.luan"
76 local web_search = Web_search.of(db) 58 local web_search = Web_search.of(db)
77 59
78 init() 60 init()