Попытка сделать нормальный поиск
This commit is contained in:
0
aore/fias/__init__.py
Normal file
0
aore/fias/__init__.py
Normal file
20
aore/fias/search.py
Normal file
20
aore/fias/search.py
Normal 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")
|
||||
Reference in New Issue
Block a user