diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-01-28 16:09:04 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2015-01-28 16:09:09 -0300 |
commit | 2652238050640d7984f9464a9487d960133af19f (patch) | |
tree | 7f8998f31de534b420e78e9b689b6677a7762856 /service/pixelated | |
parent | 188a0d0f3c8fcc3160c8b9480ebd7078a89f178c (diff) |
for #173, now searching on sender field for contacts auto complete
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/search/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/service/pixelated/adapter/search/__init__.py b/service/pixelated/adapter/search/__init__.py index 688fa4d3..a327c62e 100644 --- a/service/pixelated/adapter/search/__init__.py +++ b/service/pixelated/adapter/search/__init__.py @@ -202,6 +202,7 @@ class SearchEngine(object): to = QueryParser('to', self._index.schema) cc = QueryParser('cc', self._index.schema) bcc = QueryParser('bcc', self._index.schema) + sender = QueryParser('sender', self._index.schema) with self._index.searcher() as searcher: to = searcher.search(to.parse("*%s*" % query), limit=None, mask=restrict_q, groupedby=sorting.FieldFacet('to', allow_overlap=True)).groups() @@ -209,6 +210,8 @@ class SearchEngine(object): groupedby=sorting.FieldFacet('cc', allow_overlap=True)).groups() bcc = searcher.search(bcc.parse("*%s*" % query), limit=None, mask=restrict_q, groupedby=sorting.FieldFacet('bcc', allow_overlap=True)).groups() - return flatten([to, cc, bcc]) + sender = searcher.search(sender.parse("*%s*" % query), limit=None, mask=restrict_q, + groupedby=sorting.FieldFacet('sender', allow_overlap=True)).groups() + return flatten([to, cc, bcc, sender]) return [] |