Попытка сделать нормальный поиск

This commit is contained in:
Jack Stdin
2016-01-14 16:51:34 +03:00
parent 759efc43ee
commit 8156fa3d8d
7 changed files with 94 additions and 20 deletions

0
aore/fias/__init__.py Normal file
View File

20
aore/fias/search.py Normal file
View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
import sphinxapi
import logging
import json
class SphinxSearch:
def __init__(self):
self.client = sphinxapi.SphinxClient()
self.client.SetServer("localhost", 9312)
self.client.SetLimits(0, 10)
def find(self, text):
# TODO: ADD index
logging.info("12")
result = self.client.Query(text)
print json.dumps(result)
logging.info("12")