Ticket #245 (assigned defect)
All-stopword queries with two or more terms should ignore stopword list
| Reported by: | richard | Owned by: | olly |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | QueryParser | Version: | SVN trunk |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Operating System: | All | Blocking: |
Description
Currently, if a single word query is parsed, and that word is a stopword, the stopwording is ignored. However, if a multiple word query is parsed, and all words are stopwords, the stopwording is applied (resulting in an empty query).
If all the words in the query are stopwords, I think it may make sense to ignore the stopwording. However, even if we decide to apply the stopwording in this case, we should be consistent in our behaviour.
Some examples, in python:
import xapian s=xapian.SimpleStopper?() s.add('foo') s.add('bar') qp=xapian.QueryParser?() qp.set_stopper(s) str(qp.parse_query('foo'))
'Xapian::Query(foo:(pos=1))'
str(qp.parse_query('foo foo'))
'Xapian::Query()'
str(qp.parse_query('foo bar'))
'Xapian::Query()'
Either the first parse_query() call should return Xapian::Query(), or the later ones should return non-empty queries.
