superfastmatch
This commit is contained in:
parent
97e164e6e6
commit
85d88c1c94
@ -3,9 +3,10 @@ oyster changelog
|
|||||||
|
|
||||||
0.3.3
|
0.3.3
|
||||||
-----
|
-----
|
||||||
|
**2012-04-16**
|
||||||
* S3 storage backend bugfix
|
* S3 storage backend bugfix
|
||||||
* improvements to signal script
|
* improvements to signal script
|
||||||
* oyster.ext additions
|
* oyster.ext cloudsearch and superfastmatch
|
||||||
|
|
||||||
0.3.2
|
0.3.2
|
||||||
-----
|
-----
|
||||||
|
21
oyster/ext/superfastmatch.py
Normal file
21
oyster/ext/superfastmatch.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from celery.task.base import Task
|
||||||
|
|
||||||
|
from ..core import kernel
|
||||||
|
from ..conf import settings
|
||||||
|
|
||||||
|
from superfastmatch import Client
|
||||||
|
|
||||||
|
sfm = Client(settings.SUPERFASTMATCH_URL)
|
||||||
|
|
||||||
|
|
||||||
|
class SuperFastMatchPush(Task):
|
||||||
|
""" task that pushes documents to SFM """
|
||||||
|
|
||||||
|
# results go straight to database
|
||||||
|
ignore_result = True
|
||||||
|
|
||||||
|
def run(self, doc_id):
|
||||||
|
doc = kernel.db.tracked.find_one({'_id': doc_id})
|
||||||
|
text = kernel.extract_text(doc)
|
||||||
|
doctype, docid = settings.SUPERFASTMATCH_ID_FUNC(doc_id)
|
||||||
|
sfm.add(doctype, docid, text, **doc['metadata'])
|
Loading…
Reference in New Issue
Block a user