* catch query parse errors (see below)
* db version
* unique bibtex keys (handle conflicting) (use id?)
* rework db/doc interface
   * doc is just directory and xapian_doc
   * db does write/index on sync
* need *something* for docs without sources
   * store at least URL

* nci: translate tex in fields
* translate journal abbreviations in bibtex
* "notes" for documents (editable txt file)
* add only opens writable db on doc.sync()
* separate add and update commands
* set/get title, author, tags as data or values (is this faster?)
* gtk gui, with pdf thumbs:
   "convert -thumbnail 500x -background white -alpha remove file.pdf[0] thumb.png"
   ([0] == pdf page)
* db: can we force source prefixes to be OP_OR?

doc:
* add ability to remove source sid
* add ability to replace/remove file
* what to do with doc 'data' field:
  * snippet/summary (current)
  * data for fast retrieval?
  * bib abstract
  * custom annotations/notes
  * nothing

cli:
* utilize meta-data pulled from parser
* update should re-pull from existing source if available
* export should produce full mirror of xapers document structure, with index

nci:
* add update/add commands
* how to test??
* meta <other> for other fields (title, authors, year, etc)
* custom keybindings
* customizable palette

sources:
* add 'hdl': https://handle.net/proxy.html

parser:
* extract metadata from pdfs
* better handle parse errors
* better pdf parser (native python: https://gist.github.com/pazz/5455090)
* parsers for other document types

?
* emacs UI (need json/sexp output)
* store bib data in different format (json instead of bibtex)?
* clear old indexed terms when importing new file/bib?
* vcs integration (git of root)?


BUGS
====

* uncaught QueryParserError:

servo:~ 1$ xapers show tag:lsc date:2016...
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/xapers/__main__.py", line 330, in <module>
    nci.UI(cmd=args)
  File "/usr/lib/python2.7/dist-packages/xapers/nci/ui.py", line 75, in __init__
    self.newbuffer(cmd)
  File "/usr/lib/python2.7/dist-packages/xapers/nci/ui.py", line 96, in newbuffer
    buf = search.Search(self, query)
  File "/usr/lib/python2.7/dist-packages/xapers/nci/search.py", line 370, in __init__
    self.__set_search()
  File "/usr/lib/python2.7/dist-packages/xapers/nci/search.py", line 377, in __set_search
    count = self.ui.db.count(self.query)
  File "/usr/lib/python2.7/dist-packages/xapers/database.py", line 318, in count
    return self._search(query_string).get_matches_estimated()
  File "/usr/lib/python2.7/dist-packages/xapers/database.py", line 285, in _search
    query = self.query_parser.parse_query(query_string)
xapian.QueryParserError: Unknown range operation
servo:~ 1$ 
