Files
  • main.py
main.py
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
Article.init()
Thing.init()

thing = Thing(meta={'id': 1444}, content='thingies')
article = Article(meta={'id': 114}, content='an article ')
article.save()
thing.save()
print("saving....")
time.sleep(3)

ubq = Thing.search(using=client).query("fuzzy", content="thingie")  # change 1st arg to fuzzy
# ubq = Article.search(using=client).query("fuzzy", content="stuffie")  # change 1st arg to fuzzy

res = ubq.execute()
for i in res:
    print("first")
    print(i.content)
    i.update(content="goofball")
time.sleep(3)

ubq = Thing.search(using=client).query("fuzzy", content="goofball")  # change 1st arg to fuzzy
res = ubq.execute()
for i in res:
    print("second")
    print(i.content)