1. Matt Chaput
  2. whoosh
  3. Issues
Issue #292 resolved

Query (Term(a, b) | Not(Term(a, b))) finds nothing

created an issue

Smallest case:



from whoosh.index import create_in from whoosh.fields import * from whoosh.query import *

schema = Schema(title=TEXT(stored=True), itemtype=ID(stored=True)) ix = create_in("indexdir", schema)

writer = ix.writer() writer.add_document(title=u"a1", itemtype=u"a") writer.add_document(title=u"a2", itemtype=u"a") writer.add_document(title=u"b1", itemtype=u"b") writer.commit()

query = Term(u'itemtype', u'a') | Not(Term(u'itemtype', u'a'))

with ix.searcher() as searcher: results = searcher.search(query) print(list(results)) }}}

Running the script prints [], but it should print all documents instead.

Comments (11)

  1. Thomas Waldmann

    matt, do you think we can get it fixed in 2.4x? we have some ongoing development in moin2 that can't get merged currently because of this issue.

    otoh, we don't want to depend on 2.5/default branch as long as it is not released and gets heavy changes.

  2. Thomas Waldmann

    i tried the unit test I made (and also my fixed version of one already existing), they succeeded now. thanks for fixing!

    i guess tomorrow xiaq can do some "real life" tests with moin2 index stuff (where he noticed this issue).

  3. Log in to comment