-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upd package for MeiliSearch v0.11 (#88)
* Upd version * Add method to use faceting sub routes (#90) * Remane apikey into api_key (#93) * Implement faceting in search (#94) * Implement faceting in search * Upd test * Clear all indexes before starting tests in a certain context (#95) * Clear all indexes before starting tests in a certain context * Update meilisearch/tests/__init__.py Co-authored-by: Samuel Jimenez <[email protected]> Co-authored-by: Samuel Jimenez <[email protected]> * Upd version * Add method to use faceting sub routes (#90) * Remane apikey into api_key (#93) * Implement faceting in search (#94) * Implement faceting in search * Upd test * Fix parameter default value (#97) * Add test with multiple facetFilters (#98) * Change create_index prototype (#99) * Change create_index prototype * Update meilisearch/client.py Co-authored-by: cvermand <[email protected]> * Update meilisearch/index.py Co-authored-by: cvermand <[email protected]> Co-authored-by: cvermand <[email protected]> Co-authored-by: Samuel Jimenez <[email protected]> Co-authored-by: cvermand <[email protected]>
- Loading branch information
1 parent
04bfb17
commit f61935e
Showing
19 changed files
with
276 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
- [⚙️ Development Workflow](#️-development-workflow) | ||
- [Install dependencies](#install-dependencies) | ||
- [Tests and Linter](#tests-and-linter) | ||
- [Want to debug?](#want-to-debug) | ||
- [Release](#release) | ||
|
||
## 🔧 Installation | ||
|
@@ -66,8 +67,8 @@ NB: you can also download MeiliSearch from **Homebrew** or **APT**. | |
import meilisearch | ||
|
||
client = meilisearch.Client('http://127.0.0.1:7700', 'masterKey') | ||
index = client.create_index(uid='books') # If your index does not exist | ||
index = client.get_index('books') # If you already created your index | ||
index = client.create_index('books') # If your index does not exist | ||
index = client.get_index('books') # If you already created your index | ||
|
||
documents = [ | ||
{ 'book_id': 123, 'title': 'Pride and Prejudice' }, | ||
|
@@ -106,7 +107,7 @@ Output: | |
## 🤖 Compatibility with MeiliSearch | ||
|
||
This package is compatible with the following MeiliSearch versions: | ||
- `v0.10.X` | ||
- `v0.11.X` | ||
|
||
## 🎬 Examples | ||
|
||
|
@@ -117,9 +118,9 @@ You can check out [the API documentation](https://docs.meilisearch.com/reference | |
#### Create an index <!-- omit in toc --> | ||
```python | ||
# Create an index | ||
client.create_index(uid='books') | ||
client.create_index('books') | ||
# Create an index and give the primary-key | ||
client.create_index(uid='books', primary_key='book_id') | ||
client.create_index('books', {'primaryKey': 'book_id'}) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
curquiza
Author
Member
|
||
``` | ||
|
||
#### List all indexes <!-- omit in toc --> | ||
|
@@ -253,6 +254,20 @@ $ pipenv run pytest meilisearch | |
$ pipenv run pylint meilisearch | ||
``` | ||
|
||
### Want to debug? | ||
|
||
Import `pdb` in your file and use it: | ||
|
||
```python | ||
import pdb | ||
|
||
... | ||
pdb.set_trace() # create a break point | ||
... | ||
``` | ||
|
||
More information [about pdb](https://docs.python.org/3/library/pdb.html). | ||
|
||
### Release | ||
|
||
MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
MASTER_KEY = 'masterKey' | ||
BASE_URL = 'http://127.0.0.1:7700' | ||
|
||
def clear_all_indexes(client): | ||
indexes = client.get_indexes() | ||
for index in indexes: | ||
client.get_index(index['uid']).delete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
constantly getting error while using that method. Fixed using
client.create_index(uid='books',options={'primaryKey':'book_id'})
ref: #99