|
a/tests/pythonapi/doc.py |
|
b/tests/pythonapi/doc.py |
|
... |
|
... |
32 |
print("doc.title: [%s]"%utf8string(doc.title))
|
32 |
print("doc.title: [%s]"%utf8string(doc.title))
|
33 |
print("doc.testfield: [%s]"%utf8string(doc.testfield))
|
33 |
print("doc.testfield: [%s]"%utf8string(doc.testfield))
|
34 |
for fld in ('title', 'testfield', 'filename'):
|
34 |
for fld in ('title', 'testfield', 'filename'):
|
35 |
print("getattr(doc, %s) -> [%s]"%(fld,utf8string(getattr(doc, fld))))
|
35 |
print("getattr(doc, %s) -> [%s]"%(fld,utf8string(getattr(doc, fld))))
|
36 |
print("doc.get(%s) -> [%s]"%(fld,utf8string(doc.get(fld))))
|
36 |
print("doc.get(%s) -> [%s]"%(fld,utf8string(doc.get(fld))))
|
37 |
print("\nfor fld in doc.keys():")
|
37 |
print("\nfor fld in sorted(doc.keys()):")
|
38 |
for fld in doc.keys():
|
38 |
for fld in sorted(doc.keys()):
|
39 |
print(utf8string("[%s] -> [%s]" % (fld, getattr(doc, fld))))
|
39 |
print(utf8string("[%s] -> [%s]" % (fld, getattr(doc, fld))))
|
40 |
print("\nfor k,v in doc.items().items():")
|
40 |
print("\nfor k,v in sorted(doc.items().items()):")
|
41 |
for k,v in doc.items().items():
|
41 |
for k,v in sorted(doc.items().items(), key=lambda itm: itm[0]):
|
42 |
print(utf8string("[%s] -> [%s]" % (k, v)))
|
42 |
print(utf8string("[%s] -> [%s]" % (k, v)))
|
43 |
|
43 |
|
44 |
print("\nAccented query:")
|
44 |
print("\nAccented query:")
|
45 |
uqs = u('title:"\u00e9t\u00e9 \u00e0 no\u00ebl"')
|
45 |
uqs = u('title:"\u00e9t\u00e9 \u00e0 no\u00ebl"')
|
46 |
print("User query [%s]"%utf8string(uqs))
|
46 |
print("User query [%s]"%utf8string(uqs))
|