diff --git a/README.md b/README.md index c9f75e03..be7f438b 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,13 @@ This is a django application to provide access to search services from within ed Searching is accomplished by creating an index of documents, and then searching within that index for matching information. This application provides a way to add documents to the index, and then search for them. +## Meilisearch Engine + +edx-search includes full support for Meilisearch, and it is the default search engine in recent Open edX releases. + ## Typesense Engine -edx-search includes an optional `TypesenseEngine` backend (`search.typesense.TypesenseEngine`). +edx-search includes an optional `TypesenseEngine` backend (`search.typesense.TypesenseEngine`), which can be used as an alternative to Meilisearch or Elasticsearch. See ["Use Typesense search backend"](https://docs.openedx.org/en/latest/site_ops/how-tos/use_typesense_search_backend.html) in the site operator documentation for instructions on setting it up, if you'd like to use it. ### Server version requirement @@ -20,20 +24,6 @@ If you are running an older Typesense server you must upgrade it before deployin See the full compatibility table at https://github.com/typesense/typesense-python#compatibility. -### Enabling the Typesense engine - -```python -SEARCH_ENGINE = "search.typesense.TypesenseEngine" -``` - -You will also need to configure the Typesense connection in your Django settings (host, port, API key). -After switching, create the indices using the shell (no management command exists yet — see -https://github.com/openedx/edx-platform/issues/36868 for the longer-term plan): - -```shell -./manage.py lms shell -c "import search.typesense; search.typesense.create_indexes()" -``` - ## SearchEngine The SearchEngine is an abstract object which may have multiple implementations. As of Verawood, there are four in existence: diff --git a/edxsearch/__init__.py b/edxsearch/__init__.py index ffaf23fc..e64c0723 100644 --- a/edxsearch/__init__.py +++ b/edxsearch/__init__.py @@ -1,3 +1,3 @@ """ Container module for testing / demoing search """ -__version__ = '5.0.0' +__version__ = '5.0.1' diff --git a/search/typesense.py b/search/typesense.py index ad5880a7..0802bf3e 100644 --- a/search/typesense.py +++ b/search/typesense.py @@ -192,7 +192,7 @@ def process_document(self, doc: dict[str, t.Any]) -> dict[str, t.Any]: def search( self, - query_string="", + query_string: str | None = "", field_dictionary=None, filter_dictionary=None, exclude_dictionary=None, @@ -221,7 +221,7 @@ def search( # just using filters). index_config = INDEX_CONFIGURATION[self.index_name] query_by = index_config["query_fields"] - search_args = {"q": query_string, "query_by": query_by, **compiled_params} + search_args = {"q": query_string or "", "query_by": query_by, **compiled_params} try: results = self.typesense_index.documents.search(search_args) except (RequestMalformed, httpx.InvalidURL) as err: