Skip to content

Commit 9860695

Browse files
Added application preview to the readme and logging.info when trying to insert an existing term
1 parent 5e28b76 commit 9860695

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AutoComplete
1+
# Autocomplete
22
This project implements an website with an autocomplete box using GraphQL and Elasticsearch.
33

44
More information at [back-end](./back) and [front-end](./front) directories.
@@ -13,3 +13,13 @@ Create a `.env` from `.env.sample` and execute the command below to run the appl
1313
docker-compose up
1414
```
1515
You can also populate the application automatically setting `seed=true` at `.env`.
16+
17+
18+
## Application Preview
19+
Check out the preview below:
20+
21+
### First contact on the home page
22+
<img width="1333" alt="No suggestions" src="./assets/image_1.png">
23+
24+
### Autocomplete Suggestions
25+
<img width="1333" alt="Suggestions" src="./assets/image_2.png">

assets/image_1.png

37 KB
Loading

assets/image_2.png

50.9 KB
Loading

back/src/api/search/engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from elasticsearch import AsyncElasticsearch
22
from typing import List, Tuple
3+
import logging
34
import time
45
import requests
56

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

114115
# Check if the term already exists.
115116
if response["hits"]["total"]["value"] > 0:
116-
return
117+
return logging.info("Term already exists in the search engine.")
117118

118119
await self.client.index(
119120
index=self.term_index_name,

0 commit comments

Comments
 (0)