Problem with RamIndex and Facets quering

Issue #177 resolved
Carlo Pires
created an issue

I was looking the code and doing some tests with RamIndex class. Simple query works fine, but queries with facets don't.

{{{ from whoosh import fields, qparser, sorting

schema = fields.Schema( id=fields.NUMERIC(stored=True, unique=True), name=fields.TEXT(stored=True), nameord=fields.ID, size=fields.NUMERIC, position=fields.NUMERIC(stored=True), names=fields.KEYWORD(lowercase=True, scorable=True), )

from whoosh.ramindex import RamIndex ix = RamIndex(schema)

... populate index ...

with ix.searcher() as searcher: parser = qparser.QueryParser("name", ix.schema) query = parser.parse(text) # works fine for result in print result

# error
for result in, sortedby='size'):
    print result

Traceback (most recent call last): File "", line 161, in <module> for result in, sortedby='size'): File "/home/carlo/workspace/whooshtest/src/whoosh/", line 665, in search allow=filter, restrict=mask) File "/home/carlo/workspace/whooshtest/src/whoosh/", line 1113, in sort catter.set_searcher(s, offset) File "/home/carlo/workspace/whooshtest/src/whoosh/", line 201, in set_searcher self.fieldcache = searcher.reader().fieldcache(self.fieldname) AttributeError: 'RamIndex' object has no attribute 'fieldcache' carlo@carlo-P35-DQ6:~/workspace/whooshtest/src$


Comments (1)

  1. Log in to comment