Details
-
Bug
-
Resolution: Fixed
-
Low
-
None
-
No-Version
-
Environment:
Request Method: POST
Request URL: <a href="http://answers.atlassian.com/api/search/" target="_blank">http://answers.atlassian.com/<WBR>api/search/</a>
Django Version: 1.2.5
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.sitemaps',
'django.contrib.markup',
'forum',
'haystack',
'south',
'imagekit']
Installed Middleware:
['django.contrib.sessions.<WBR>middleware.SessionMiddleware',
'django.middleware.common.<WBR>CommonMiddleware',
'forum.middleware.extended_<WBR>user.ExtendedUser',
'forum.middleware.anon_user.<WBR>ConnectToSessionMessagesMiddle<WBR>ware',
'forum.middleware.request_<WBR>utils.RequestUtils',
'forum.middleware.cancel.<WBR>CancelActionMiddleware',
'django.middleware.<WBR>transaction.<WBR>TransactionMiddleware',
'django.middleware.csrf.<WBR>CsrfViewMiddleware',
'dogslow.WatchdogMiddleware']Traceback:
File "/opt/python/domains/<a href="http://atlassian.com/answers/ADM-22880/forum_modules/atlassian/api/handlers.py" target="blank">atlassian<WBR>.com/answers/ADM-22880/forum<WBR>modules/atlassian/api/<WBR>handlers.py</a>" in create
180. return self.do_search(data)
File "/opt/python/domains/<a href="http://atlassian.com/answers/ADM-22880/forum_modules/atlassian/api/handlers.py" target="blank">atlassian<WBR>.com/answers/ADM-22880/forum<WBR>modules/atlassian/api/<WBR>handlers.py</a>" in do_search
225. length = search_results.count()
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/query.<WBR>py</a>" in count
434. return len(self)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/query.py" target="blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/query.<WBR>py</a>" in __len_
67. self._result_count = self.query.get_count()
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_init.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/init_.py</a>" in get_count
433. self.run()
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_init.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/init_.py</a>" in run
379. results = self.backend.search(final_<WBR>query, **kwargs)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_init.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/init_.py</a>" in wrapper
47. return func(obj, query_string, *args, **kwargs)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/whoosh_backend.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/whoosh_backend.py</a>" in search
367. raw_results = searcher.search(parsed_query, limit=end_offset, sortedby=sort_by, reverse=reverse)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in search
696. return collector.search(self, q, allow=filter, restrict=mask)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in search
989. self.add_matches(q, offset, scorefn)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in add_matches
1003. for score, offsetid in self.pull_matches(q, offset, scorefn):
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in pull_matches
1036. matcher = q.matcher(self.subsearcher)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/query.py</a>" in matcher
964. lambda q: 0 - q.estimate_size(r), searcher)
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/query.py</a>" in _matcher
775. subms = [(q_weight_fn(q), q.matcher(searcher)) for q in subs]
File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/query.py</a>" in matcher
1767. % self.fieldname)Exception Type: QueryError at /api/search/
Exception Value: Phrase search: u'tags' field has no positionsEnvironment: Request Method: POST Request URL: <a href="http://answers.atlassian.com/api/search/" target="_blank"> http://answers.atlassian.com/ <WBR>api/search/</a> Django Version: 1.2.5 Python Version: 2.6.5 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.humanize', 'django.contrib.sitemaps', 'django.contrib.markup', 'forum', 'haystack', 'south', 'imagekit'] Installed Middleware: ['django.contrib.sessions.<WBR>middleware.SessionMiddleware', 'django.middleware.common.<WBR>CommonMiddleware', 'forum.middleware.extended_<WBR>user.ExtendedUser', 'forum.middleware.anon_user.<WBR>ConnectToSessionMessagesMiddle<WBR>ware', 'forum.middleware.request_<WBR>utils.RequestUtils', 'forum.middleware.cancel.<WBR>CancelActionMiddleware', 'django.middleware.<WBR>transaction.<WBR>TransactionMiddleware', 'django.middleware.csrf.<WBR>CsrfViewMiddleware', 'dogslow.WatchdogMiddleware'] Traceback: File "/opt/python/domains/<a href="http://atlassian.com/answers/ADM-22880/forum_modules/atlassian/api/handlers.py" target=" blank">atlassian<WBR>.com/answers/ADM-22880/forum <WBR>modules/atlassian/api/<WBR>handlers.py</a>" in create 180. return self.do_search(data) File "/opt/python/domains/<a href="http://atlassian.com/answers/ADM-22880/forum_modules/atlassian/api/handlers.py" target=" blank">atlassian<WBR>.com/answers/ADM-22880/forum <WBR>modules/atlassian/api/<WBR>handlers.py</a>" in do_search 225. length = search_results.count() File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/query.<WBR>py</a>" in count 434. return len(self) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/query.py" target=" blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/query.<WBR>py</a>" in __len _ 67. self._result_count = self.query.get_count() File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_ init .py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/ init _.py</a>" in get_count 433. self.run() File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_ init .py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/ init _.py</a>" in run 379. results = self.backend.search(final_<WBR>query, **kwargs) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_ init .py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/ init _.py</a>" in wrapper 47. return func(obj, query_string, *args, **kwargs) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/whoosh_backend.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/haystack/<WBR>backends/whoosh_backend.py</a>" in search 367. raw_results = searcher.search(parsed_query, limit=end_offset, sortedby=sort_by, reverse=reverse) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in search 696. return collector.search(self, q, allow=filter, restrict=mask) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in search 989. self.add_matches(q, offset, scorefn) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in add_matches 1003. for score, offsetid in self.pull_matches(q, offset, scorefn): File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/<WBR>searching.py</a>" in pull_matches 1036. matcher = q.matcher(self.subsearcher) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/query.py</a>" in matcher 964. lambda q: 0 - q.estimate_size(r), searcher) File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/query.py</a>" in _matcher 775. subms = [(q_weight_fn(q), q.matcher(searcher)) for q in subs] File "/opt/python/domains/<a href="http://atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py" target="_blank">atlassian<WBR>.com/answers/lib/python2.6/<WBR>site-packages/whoosh/query.py</a>" in matcher 1767. % self.fieldname) Exception Type: QueryError at /api/search/ Exception Value: Phrase search: u'tags' field has no positions
-
Severity 3 - Minor
-
Description
NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.
QueryError at /api/search/
Phrase search: u'tags' field has no positions
Request Method: POST
Request URL: http://answers.atlassian.com/api/search/
Django Version: 1.2.5
Exception Type: QueryError
Exception Value:
Phrase search: u'tags' field has no positions
Exception Location: /opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py in matcher, line 1767
Python Executable: /opt/python/domains/atlassian.com/answers/bin/python2.6
Python Version: 2.6.5
Python Path: ['/opt/python/domains/atlassian.com/answers/ADM-22880', '/opt/python/domains/atlassian.com/answers', '/opt/python/domains/atlassian.com/answers/bin', '/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/pip-0.8.3-py2.6.egg', '/opt/python/domains/atlassian.com/answers/lib64/python26.zip', '/opt/python/domains/atlassian.com/answers/lib64/python2.6', '/opt/python/domains/atlassian.com/answers/lib64/python2.6/plat-linux2', '/opt/python/domains/atlassian.com/answers/lib64/python2.6/lib-tk', '/opt/python/domains/atlassian.com/answers/lib64/python2.6/lib-old', '/opt/python/domains/atlassian.com/answers/lib64/python2.6/lib-dynload', '/usr/lib/python2.6', '/usr/lib64/python2.6', '/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages', '/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/PIL', '/usr/lib/python2.6/site-packages/pip-0.8.3-py2.6.egg', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info', '/usr/lib64/python2.6/site-packages', '/opt/python/domains/atlassian.com/answers/ADM-22880/forum/markdownext']
Server time: Fri, 27 Apr 2012 16:58:30 -0400
Traceback Switch to copy-and-paste view
/opt/python/domains/atlassian.com/answers/ADM-22880/forum_modules/atlassian/api/handlers.py in create
return self.linksDoc(request)
def create(self, request):
data = QueryDict(request.GET.urlencode(), True)
if request.data:
data.update(request.data)
if 'query' in data or 'tags' in data or 'tag' in data:
return self.do_search(data) ...
else:
res = rc.BAD_REQUEST
res.write('\nQuery must contain one or more "query" or "tag" params.\nPOST with application/json or use GET')
return res
def do_search(self, data):
▶ Local vars
Variable Value
data
<QueryDict:
>
request
<WSGIRequest GET:<QueryDict: {}>, POST:{}, COOKIES:{}, META:
>
self
<forum_modules.atlassian.api.handlers.SearchHandler object at 0x215fe350>
/opt/python/domains/atlassian.com/answers/ADM-22880/forum_modules/atlassian/api/handlers.py in do_search
}.get(sort, sort)
search_results = SearchQuerySet()
if 'query' in data:
search_results = search_results.filter(content=data['query'])
if 'tag' in data:
search_results = search_results.filter(tags__in=data.getlist('tag'))
length = search_results.count() ...
if sort:
search_results = search_results.order_by(sort)
while offset < 0:
offset += length
end = offset+limit
- Seems Haystack 1.2.6's slice is somewhat broken – sqs[start:end]
▶ Local vars
Variable Value
_sort
None
bad_request
<function bad_request at 0x2aaaba4569b0>
data
<QueryDict: {u'query': [u'Confluence Developer Documentation'], u'tag': [[u'confluence-plugins', u'confluence-development']]}>
{'end_offset': 10, 'result_class': <class 'haystack.models.SearchResult'>, 'start_offset': 0}
limit
5
offset
0
reversed
False
search_results
Error in formatting: Phrase search: u'tags' field has no positions
self
<forum_modules.atlassian.api.handlers.SearchHandler object at 0x215fe350>
sort
None
tag
[[u'confluence-plugins', u'confluence-development']]
Variable Value
self
<haystack.backends.whoosh_backend.SearchQuery object at 0x223c61d0>
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_init_.py in run
return kwargs
def run(self, spelling_query=None):
"""Builds and executes the query. Returns a list of search results."""
final_query = self.build_query()
kwargs = self.build_params(spelling_query=spelling_query)
results = self.backend.search(final_query, **kwargs) ...
self._results = results.get('results', [])
self._hit_count = results.get('hits', 0)
self._facet_counts = self.post_process_facets(results)
self._spelling_suggestion = results.get('spelling_suggestion', None)
def run_mlt(self):
▶ Local vars
Variable Value
final_query
u'("Confluence Developer Documentation" AND (tags:"confluence-plugins,confluence-development"))'
kwargsself
<haystack.backends.whoosh_backend.SearchQuery object at 0x223c61d0>
spelling_query
None
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/haystack/backends/_init_.py in wrapper
A decorator for pseudo-logging search queries. Used in the ``SearchBackend``
to wrap the ``search`` method.
"""
def wrapper(obj, query_string, *args, **kwargs):
start = time()
try:
return func(obj, query_string, *args, **kwargs) ...
finally:
stop = time()
if settings.DEBUG:
global queries
queries.append(Unknown macro: {▶ Local varsVariable Valueargs ()func <function search at 0x20cdf230>kwargs {'end_offset': 10, 'result_class': <class 'haystack.models.SearchResult'>, 'start_offset': 0}obj <haystack.backends.whoosh_backend.SearchBackend object at 0x223c6810>query_string u'("Confluence Developer Documentation" AND (tags}limit_to_registered_models
True
narrow_queries
set([u'django_ct:forum.question'])
narrow_searcher
<whoosh.searching.Searcher object at 0x2214f550>
narrowed_results
<Top 10 Results for Term(u'django_ct', u'forum.question') runtime=0.103665828705>
nq
u'django_ct:forum.question'
parsed_query
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
query_facets
None
query_string
u'("Confluence Developer Documentation" AND (tags:"confluence-plugins,confluence-development"))'
recent_narrowed_results
<Top 10 Results for Term(u'django_ct', u'forum.question') runtime=0.103665828705>
registered_models
[u'forum.question']
result_class
<class 'haystack.models.SearchResult'>
reverse
False
rm
u'forum.question'
searcher
<whoosh.searching.Searcher object at 0x2289f450>
self
<haystack.backends.whoosh_backend.SearchBackend object at 0x223c6810>
sort_by
None
spelling_query
None
start_offset
0
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py in search
groupedby=groupedby, terms=terms,
maptype=maptype)
if sortedby:
return collector.sort(self, q, sortedby, reverse=reverse,
allow=filter, restrict=mask)
else:
return collector.search(self, q, allow=filter, restrict=mask) ...
def correct_query(self, q, qstring, correctors=None, allfields=False,
terms=None, prefix=0, maxdist=2):
"""Returns a corrected version of the given user query using a default
:class:`whoosh.spelling.ReaderCorrector`.
▶ Local vars
Variable Value
collector
<whoosh.searching.Collector object at 0x220e1ad0>
filter
None
groupedby
None
limit
10
maptype
None
mask
None
optimize
True
q
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
reverse
False
self
<whoosh.searching.Searcher object at 0x2289f450>
sortedby
None
terms
False
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py in search
else:
searchers = searcher.subsearchers
for s, offset in searchers:
scorefn = self._score_fn(s)
self.subsearcher = s
self._set_categorizers(s, offset)
self.add_matches(q, offset, scorefn) ... - If we started a time limit timer thread, cancel it
if self.timelimit and self.timer:
self.timer.cancel()
self.runtime = now() - t
▶ Local vars
Variable Value
allow
None
offset
24
q
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
restrict
None
s
<whoosh.searching.Searcher object at 0x2aaab7b5f210>
scorefn
None
searcher
<whoosh.searching.Searcher object at 0x2289f450>
searchers
[(<whoosh.searching.Searcher object at 0x2aaab7b5f290>, 0), (<whoosh.searching.Searcher object at 0x2aaab7b5f550>, 11), (<whoosh.searching.Searcher object at 0x2aaab7b5f210>, 24), (<whoosh.searching.Searcher object at 0x2aaab7b5f810>, 295), (<whoosh.searching.Searcher object at 0x2aaab7b5ff50>, 1295), (<whoosh.searching.Searcher object at 0x2aaab7b5f850>, 2295), (<whoosh.searching.Searcher object at 0x2aaab7b5fa10>, 3295), (<whoosh.searching.Searcher object at 0x2aaab7b5f6d0>, 4295), (<whoosh.searching.Searcher object at 0x2aaab7b5fcd0>, 5295), (<whoosh.searching.Searcher object at 0x220e14d0>, 6295), (<whoosh.searching.Searcher object at 0x220e1c10>, 7295), (<whoosh.searching.Searcher object at 0x220e1ed0>, 8295), (<whoosh.searching.Searcher object at 0x220e16d0>, 9295), (<whoosh.searching.Searcher object at 0x220e15d0>, 10295), (<whoosh.searching.Searcher object at 0x220e1610>, 11295), (<whoosh.searching.Searcher object at 0x220e1390>, 12295)]
self
<whoosh.searching.Collector object at 0x220e1ad0>
t
1335560310.119328
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py in add_matches
return self.results()
def add_matches(self, q, offset, scorefn):
items = self.items
limit = self.limit
addall = self.should_add_all()
for score, offsetid in self.pull_matches(q, offset, scorefn): ... - Document numbers are negated before putting them in the heap so
- that higher document numbers have lower "priority" in the queue.
- Lower document numbers should always come before higher document
- numbers with the same score to keep the order stable.
negated_offsetid = 0 - offsetid
▶ Local vars
Variable Value
addall
False
items
[]
limit
10
offset
24
q
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
scorefn
None
self
<whoosh.searching.Collector object at 0x220e1ad0>
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/searching.py in pull_matches
restrict = self.restrict
replace = self.replace
collect = self.collect
minscore = self.minscore
replacecounter = 0
timelimited = bool(self.timelimit)
matcher = q.matcher(self.subsearcher) ...
usequality = self.use_block_quality(self.subsearcher, matcher)
termlists = self.termlists
recordterms = termlists is not None
if recordterms:
termmatchers = list(matcher.term_matchers())
▶ Local vars
Variable Value
allow
None
collect
<bound method Collector.collect of <whoosh.searching.Collector object at 0x220e1ad0>>
minscore
None
offset
24
q
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
replace
10
replacecounter
0
restrict
None
scorefn
None
self
<whoosh.searching.Collector object at 0x220e1ad0>
timelimited
False
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py in matcher
def estimate_size(self, ixreader):
return min(q.estimate_size(ixreader) for q in self.subqueries)
def matcher(self, searcher):
r = searcher.reader()
return self._matcher(IntersectionMatcher,
lambda q: 0 - q.estimate_size(r), searcher) ...
class Or(CompoundQuery):
"""Matches documents that match ANY of the subqueries.
>>> Or([Term("content", u"render"),
▶ Local vars
Variable Value
r
SegmentReader(<Segment '_MAIN_13' ccb20e95-5d7a-49f4-8f91-deda5fffc994>)
searcher
<whoosh.searching.Searcher object at 0x2aaab7b5f210>
self
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py in _matcher - Create a matcher from the list of subqueries
if len(subs) == 1:
m = subs[0].matcher(searcher)
elif q_weight_fn is None:
subms = [q.matcher(searcher) for q in subs]
m = make_binary_tree(matchercls, subms)
else:
subms = [(q_weight_fn(q), q.matcher(searcher)) for q in subs] ...
m = make_weighted_tree(matchercls, subms) - If there were queries inside Not(), make a matcher for them and
- wrap the matchers in an AndNotMatcher
if nots:
if len(nots) == 1:
▶ Local vars
Variable Value
_[2]
[(-21, SpanNearMatcher(IntersectionMatcher(FilePostingReader('_MAIN_13.pst', ('text', u'confluenc'), True, 51), SpanNearMatcher(IntersectionMatcher(FilePostingReader('_MAIN_13.pst', ('text', u'develop'), True, 256), FilePostingReader('_MAIN_13.pst', ('text', u'document'), False)), boost=1.0)), boost=1.0))]
kwargs
{}
matchercls
<class 'whoosh.matching.IntersectionMatcher'>
nots
[]
q
Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)
q_weight_fn
<function <lambda> at 0x22674f50>
searcher
<whoosh.searching.Searcher object at 0x2aaab7b5f210>
self
And([Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)])
subs
[Phrase('text', [u'confluenc', u'develop', u'document'], slop=1, boost=1.000000), Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)]
/opt/python/domains/atlassian.com/answers/lib/python2.6/site-packages/whoosh/query.py in matcher
for word in self.words:
if (fieldname, word) not in reader:
return NullMatcher()
field = searcher.schema[fieldname]
if not field.format or not field.format.supports("positions"):
raise QueryError("Phrase search: %r field has no positions"
% self.fieldname) ... - Construct a tree of SpanNear queries representing the words in the
- phrase and return its matcher
from whoosh.spans import SpanNear
q = SpanNear.phrase(fieldname, self.words, slop=self.slop)
m = q.matcher(searcher)
▶ Local vars
Variable Value
field
KEYWORD(format=Frequency(boost=1.0), vector=None, scorable=True, stored=True, unique=False)
fieldname
u'tags'
reader
SegmentReader(<Segment '_MAIN_13' ccb20e95-5d7a-49f4-8f91-deda5fffc994>)
searcher
<whoosh.searching.Searcher object at 0x2aaab7b5f210>
self
Phrase(u'tags', [u'confluence-plugins', u'confluence-development'], slop=1, boost=1.000000)
word
u'confluence-development'
Attachments
Issue Links
- relates to
-
CONFCLOUD-46704 QueryError at /api/search/
- Closed