no sematic search
Browse files
App/Embedding/EmbeddingRoutes.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from fastapi import APIRouter, BackgroundTasks
|
2 |
|
3 |
-
from .utils.Initialize import TextSearch, IdSearch, LookUpIds
|
4 |
from .Schemas import SearchRequest, AddDocumentRequest, TrendingRequest
|
5 |
import redis, os, json
|
6 |
|
@@ -19,7 +19,7 @@ async def create_embeddings(req: AddDocumentRequest):
|
|
19 |
|
20 |
@embeddigs_router.post("/LookUp")
|
21 |
async def getTrending(req: TrendingRequest):
|
22 |
-
return
|
23 |
|
24 |
|
25 |
@embeddigs_router.post("/search_id")
|
@@ -27,15 +27,19 @@ async def search_id(
|
|
27 |
req: SearchRequest,
|
28 |
background_tasks: BackgroundTasks,
|
29 |
):
|
|
|
30 |
data = cache.get(f"recommendations:{req.query}")
|
31 |
if data is not None:
|
32 |
return json.loads(data)
|
|
|
|
|
33 |
|
34 |
-
data = IdSearch(query=req.query, background_task=background_tasks)
|
35 |
-
cache.set(f"recommendations:{req.query}", json.dumps(data), ex=72000)
|
36 |
-
return data
|
37 |
|
38 |
|
39 |
@embeddigs_router.post("/search_text")
|
40 |
async def search_text(reqx: SearchRequest):
|
41 |
-
return
|
|
|
|
1 |
from fastapi import APIRouter, BackgroundTasks
|
2 |
|
3 |
+
# from .utils.Initialize import TextSearch, IdSearch, LookUpIds
|
4 |
from .Schemas import SearchRequest, AddDocumentRequest, TrendingRequest
|
5 |
import redis, os, json
|
6 |
|
|
|
19 |
|
20 |
@embeddigs_router.post("/LookUp")
|
21 |
async def getTrending(req: TrendingRequest):
|
22 |
+
return []
|
23 |
|
24 |
|
25 |
@embeddigs_router.post("/search_id")
|
|
|
27 |
req: SearchRequest,
|
28 |
background_tasks: BackgroundTasks,
|
29 |
):
|
30 |
+
# return []
|
31 |
data = cache.get(f"recommendations:{req.query}")
|
32 |
if data is not None:
|
33 |
return json.loads(data)
|
34 |
+
else:
|
35 |
+
return []
|
36 |
|
37 |
+
# data = IdSearch(query=req.query, background_task=background_tasks)
|
38 |
+
# cache.set(f"recommendations:{req.query}", json.dumps(data), ex=72000)
|
39 |
+
# return data
|
40 |
|
41 |
|
42 |
@embeddigs_router.post("/search_text")
|
43 |
async def search_text(reqx: SearchRequest):
|
44 |
+
return []
|
45 |
+
# return TextSearch(query=reqx.query)
|