Commit d1a72133 authored by Mario Chirinos's avatar Mario Chirinos

websearch

parent 1ce71689
......@@ -52,6 +52,7 @@ AUDIOPATH = "/home/geoint/M3_NFS/recordings/"
from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector, SearchHeadline
from django.db.models import Value
import html
import string
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
......@@ -275,7 +276,10 @@ def newsList(request, publisherShortName="all"):
def newsDetails(request, newsId):
form = SearchForm(request.GET)
news = News.objects.get(id=newsId)
for i in request.GET['text'].split():
translator = str.maketrans('', '', string.punctuation)
text = request.GET['text'].translate(translator)
for i in text.split():
print("search for: ", i)
txtlen = len(i)
index = news.text.lower().find(i.lower())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment