Ticket #1090 (closed enhancement: fixed)
refactor indexing/query parsing, add support for prefixes
| Reported by: | sascha_silbe | Owned by: | tomeu |
|---|---|---|---|
| Priority: | Unspecified by Maintainer | Milestone: | Unspecified by Release Team |
| Component: | sugar-datastore | Version: | Git as of bugdate |
| Severity: | Unspecified | Keywords: | r+ |
| Cc: | Distribution/OS: | Unspecified | |
| Bug Status: | New |
Description
The attached patch refactors the indexing (term generation) and query parsing code in indexstore.py.
Now adding a new attribute requires only two lines to be added. This will come in quite handy when adding all the attributes proposed by alsroot. :)
In addition, prefix search (e.g. "activity:calculate") and phrase search (e.g. "org.laptop.Calculate") now work (in addition to non-prefix search - e.g. "activity:org.laptop.calculate" and "org.laptop.calculate" usually return the same set of entries).
Date range search is implemented, but doesn't work with current Journal because it appends an asterisk to each term. This also seems to confuse Xapian for certain phrase queries (e.g. "activity:org.lap" doesn't work, but "activity:or" and "activity:org.laptop" do work). Also the date parser isn't very tolerant.

