Skip to content

Commit

Permalink
Fix documentation in create_index
Browse files Browse the repository at this point in the history
  • Loading branch information
mnunberg committed Feb 14, 2018
1 parent c390bf8 commit b390106
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
41 changes: 39 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ If conn is not None, we employ an already existing redis connection
### add\_document
```py

def add_document(self, doc_id, nosave=False, score=1.0, payload=None, replace=False, partial=False, **fields)
def add_document(self, doc_id, nosave=False, score=1.0, payload=None, replace=False, partial=False, language=None, **fields)

```

Expand All @@ -190,6 +190,7 @@ Add a single document to the index.
- **partial**: if True, the fields specified will be added to the existing document.
This has the added benefit that any fields specified with `no_index`
will not be reindexed again. Implies `replace`
- **language**: Specify the language used for document tokenization.
- **fields** kwargs dictionary of the document fields to be saved and/or indexed.
NOTE: Geo points shoule be encoded as strings of "lon,lat"

Expand All @@ -215,7 +216,7 @@ def create_index(self, fields, no_term_offsets=False, no_field_flags=False, stop



Create the search index. Creating an existing index juts updates its properties
Create the search index. The index must not already exist.

### Parameters:

Expand Down Expand Up @@ -498,6 +499,19 @@ Match only documents where the query terms appear in the same order in the docum
i.e. for the query 'hello world', we do not match 'world hello'


### language
```py

def language(self, language)

```



Analyze the query as being in the specified language
:param language: The language (e.g. `chinese` or `english`)


### limit\_fields
```py

Expand Down Expand Up @@ -706,6 +720,29 @@ def __init__(self, string, score=1.0, payload=None)



## Class TagField
TagField is a tag-indexing field with simpler compression and tokenization.
See http://redisearch.io/Tags/
### \_\_init\_\_
```py

def __init__(self, name, separator=',', no_index=False)

```



### redis\_args
```py

def redis_args(self)

```





## Class TextField
TextField is used to define a text field in a schema definition
### \_\_init\_\_
Expand Down
4 changes: 2 additions & 2 deletions redisearch/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def batch_indexer(self, chunk_size=100):
def create_index(self, fields, no_term_offsets=False,
no_field_flags=False, stopwords = None):
"""
Create the search index. Creating an existing index juts updates its properties
Create the search index. The index must not already exist.
### Parameters:
Expand Down Expand Up @@ -313,4 +313,4 @@ def search(self, query):

def explain(self, query):
args, query_text = self._mk_query_args(query)
return self.redis.execute_command(self.EXPLAIN_CMD, *args)
return self.redis.execute_command(self.EXPLAIN_CMD, *args)

0 comments on commit b390106

Please sign in to comment.