X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f109b7f6e35d54281f1edf4b684c49db621d36c5..ae60b2a3949e96357477cc04f90fd0873cee8a92:/apps/search/views.py diff --git a/apps/search/views.py b/apps/search/views.py deleted file mode 100644 index 5ed610705..000000000 --- a/apps/search/views.py +++ /dev/null @@ -1,27 +0,0 @@ - - -from django.shortcuts import render_to_response, get_object_or_404 -from django.template import RequestContext -from django.contrib.auth.decorators import login_required -from django.views.decorators import cache - -from catalogue.utils import get_random_hash -from catalogue.models import Book, Tag -from catalogue import forms -from search import MultiSearch, JVM - - -def main(request): - results = {} - JVM.attachCurrentThread() # where to put this? - srch = MultiSearch() - - results = None - if 'q' in request.GET: - toks = srch.get_tokens(request.GET['q']) - results = srch.search_perfect(toks) + srch.search_everywhere(toks) - results.sort(lambda a, b: cmp(a[0], b[0]) < 0) - print("searched, results are: %s\n" % results) - - return render_to_response('newsearch/search.html', {"results": results}, - context_instance=RequestContext(request))