diff --git a/README.md b/README.md index 1d4d73e..4601e9c 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ To set up the demo, run the following command: vectory demo ``` -You can specify the demo dataset with the `dataset_name` argument. See `vectory demo --help` for more information. +You can specify the demo dataset by adding the name as the next argument. See `vectory demo --help` for more information.

diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 5d32a40..ccbedb3 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -23,6 +23,41 @@ sqlite3.OperationalError: database is locked ``` Just stop the running instance of Vectory and try again. + +### Index already exists + +If adding an index to the database fails in a way we haven't anticipated, it might happen that the index is loaded in Elasticsearch but not in the database. This can be checked by comparing the indices on both places: + +```python +from vectory.db.models import ElasticSearchIndexModel, Query +from vectory.es.client import ElasticKNNClient + +es = ElasticKNNClient() +es_indices = es.list_indices() + +db_indices = Query(ElasticSearchIndexModel).get() +``` + +`es_indices` and `db_indices` should be the same. + +If the index is on Elasticsearch but not in the database, delete it from Elasticsearch and try again. + +```python +from vectory.es.client import ElasticKNNClient + +es = ElasticKNNClient() +es.delete_index(INDEX_NAME) +``` + +If the index is in the database but not on Elasticsearch, delete it from the database and try again. + +``` +from vectory.db.models import ElasticSearchIndexModel, Query + +index = Query(ElasticSearchIndexModel).get(name=INDEX_NAME)[0] +index.delete_instance(recursive=False) +``` + ## Import errors ### No module `pkg_resources`