Commit 7e1afa52 authored by Mario Chirinos's avatar Mario Chirinos

websearch

parent c0ce9a32
......@@ -49,7 +49,7 @@ from stop_words import get_stop_words
#from django.contrib.postgres.lookups import Unaccent
AUDIOPATH = "/home/geoint/M3_NFS/recordings/"
from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector
from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector, SearchHeadline
from django.db.models import Value
import html
#-------------------------------------------------------------------------------
......@@ -275,7 +275,7 @@ def newsList(request, publisherShortName="all"):
def newsDetails(request, newsId):
form = SearchForm(request.GET)
news = News.objects.get(id=newsId)
from django.contrib.postgres.search import SearchHeadline, SearchQuery
for i in request.GET['text'].split():
news.text = news.text.replace(i, "<b>"+i+"</b>")
news.text = news.text.replace(new RegExp(i, "gi"), (match) => '<b>${match}</b>');
......
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