def get(self, request, *args, **kwargs): complete = request.GET.get("complete") if complete: page_index = get_index_by_name("pages") result = get_connection().completion_suggest(page_index, complete, fuzzy=2) return HttpResponse(content=json.dumps(result.options), content_type="application/json") return super(SearchView, self).get(request, *args, **kwargs)
def handle(self, *args, **options): conn = get_connection() index = get_index_by_name("pages") wg = WordGatherer(conn, "word-suggest") wg.reset() wg.update(index, ("abstract", "title"), tokenizer=smart_finnish_tokenizer) for x in wg.search("juna"): print x
def handle(self, *args, **options): conn = get_connection() index = get_index_by_name("pages") wg = WordGatherer(conn, "word-suggest") wg.reset() wg.update(index, ("abstract", "title"), tokenizer=smart_finnish_tokenizer) for x in wg.search("juna"): print x
def get(self, request, *args, **kwargs): complete = request.GET.get("complete") if complete: page_index = get_index_by_name("pages") result = get_connection().completion_suggest(page_index, complete, fuzzy=2) return HttpResponse(content=json.dumps(result.options), content_type="application/json") return super(SearchView, self).get(request, *args, **kwargs)