Skip to content

Commit

Permalink
Added application preview to the readme and logging.info when trying …
Browse files Browse the repository at this point in the history
…to insert an existing term
  • Loading branch information
JeanExtreme002 committed Jul 15, 2024
1 parent 5e28b76 commit 9860695
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AutoComplete
# Autocomplete
This project implements an website with an autocomplete box using GraphQL and Elasticsearch.

More information at [back-end](./back) and [front-end](./front) directories.
Expand All @@ -13,3 +13,13 @@ Create a `.env` from `.env.sample` and execute the command below to run the appl
docker-compose up
```
You can also populate the application automatically setting `seed=true` at `.env`.


## Application Preview
Check out the preview below:

### First contact on the home page
<img width="1333" alt="No suggestions" src="./assets/image_1.png">

### Autocomplete Suggestions
<img width="1333" alt="Suggestions" src="./assets/image_2.png">
Binary file added assets/image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion back/src/api/search/engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from elasticsearch import AsyncElasticsearch
from typing import List, Tuple
import logging
import time
import requests

Expand Down Expand Up @@ -113,7 +114,7 @@ async def insert_term(self, term: str) -> None:

# Check if the term already exists.
if response["hits"]["total"]["value"] > 0:
return
return logging.info("Term already exists in the search engine.")

await self.client.index(
index=self.term_index_name,
Expand Down

0 comments on commit 9860695

Please sign in to comment.