Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion edxsearch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" Container module for testing / demoing search """

__version__ = '5.0.0'
__version__ = '5.0.1'
4 changes: 2 additions & 2 deletions search/typesense.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down
Loading