@@ -40,29 +40,32 @@ For more details, visit [http://redisearch.io](http://redisearch.io)
4040from redisearch import Client, TextField
4141
4242# Creating a client with a given index name
43- client = Client(' myIndex' )
43+ client = Client(" myIndex" )
4444
4545# Creating the index definition and schema
46- client.create_index((TextField(' title' , weight = 5.0 ), TextField(' body' )))
46+ client.create_index((TextField(" title" , weight = 5.0 ), TextField(" body" )))
4747
4848# Indexing a document
49- client.add_document(' doc1' , title = ' RediSearch' , body = ' Redisearch impements a search engine on top of redis' )
49+ client.add_document(
50+ " doc1" ,
51+ title = " RediSearch" ,
52+ body = " Redisearch implements a search engine on top of redis" ,
53+ )
5054
5155# Simple search
5256res = client.search(" search engine" )
5357
5458# Searching with snippets
55- res = client.search(" search engine" , snippet_sizes = { ' body' : 50 })
59+ res = client.search(" search engine" , snippet_sizes = { " body" : 50 })
5660
57- # Searching with complext parameters:
58- q = Query(" search engine" ).verbatim().no_content().with_scores().paging(0 ,5 )
61+ # Searching with complex parameters:
62+ q = Query(" search engine" ).verbatim().no_content().with_scores().paging(0 , 5 )
5963res = client.search(q)
6064
6165
62- # the result has the total number of results, and a list of documents
63- print res.total # "1"
64- print res.docs[0 ].title
65-
66+ # The result has the total number of results, and a list of documents
67+ print (res.total) # "1"
68+ print (res.docs[0 ].title)
6669```
6770
6871## Installing
0 commit comments