Added check for non-existing doc bit vector in the cache

Change-Id: Icd770b0452b9208a0e0c44f7ec62f1aaf5aaf458
diff --git a/Changes b/Changes
index 0952d84..57ecbbd 100644
--- a/Changes
+++ b/Changes
@@ -1,614 +1,615 @@
-0.58.0 2018-07-30
-        - Implemented referencing cached collection (margaretha)
-        - Implemented deserialization of collection with array values and cache option (margaretha)
-        - Implemented caching collection (margaretha)
-        - Implemented KrillCollection cache clearing (margaretha)
-        - Implemented auto-caching (margaretha)
-        - Implemented serializable doc bits vector for caching on disk (margaretha)
+0.58.0 2018-08-02
+    - Implemented referencing cached collection (margaretha)
+    - Implemented deserialization of collection with array values and cache option (margaretha)
+    - Implemented caching collection (margaretha)
+    - Implemented KrillCollection cache clearing (margaretha)
+    - Implemented auto-caching (margaretha)
+    - Implemented serializable doc bits vector for caching on disk (margaretha)
+    - Added check for non-existing doc bit vector in the cache (margaretha) 
 
 0.57 2018-04-05
-        - [feature] Support text queries in metadata
-          (requires reindexing to work properly; diewald)
-        - [cleanup] Remove unnecessary case folding in meta field
-          text queries (diewald)
+    - [feature] Support text queries in metadata
+      (requires reindexing to work properly; diewald)
+    - [cleanup] Remove unnecessary case folding in meta field
+      text queries (diewald)
 
 0.56.2 2018-03-23
-        - [feature] Introduce meta field retrieval method (diewald)
-        - [cleanup] Rename KrillQuery's "_"-method to "nr" to improve
-          compatibility with future versions of Java (diewald)
-        - [bugfix] Fixed expansion to respect character boundaries
-          (diewald)
-        - [bugfix] Fixed wrong behaviour of textual non-contexts in
-          snippet generation (diewald)
-        - [bugfix] Removed problematic serialization of empty
-          annotations (diewald)
-        - [feature] Serialize metadata keywords as arrays, when
-          indexed properly (may require reindexing; diewald)
-        - [feature] Serialize dates in dash separation format, when
-          metadata field name ends with "Date" (diewald)
-        - [bugfix] Fixed left exclusion-expansion when there is no 
-          more span for SpanOrQuery (margaretha)
-        - [bugfix] Fixed matchID response to be always identical to
-          a given matchID (diewald)
+    - [feature] Introduce meta field retrieval method (diewald)
+    - [cleanup] Rename KrillQuery's "_"-method to "nr" to improve
+      compatibility with future versions of Java (diewald)
+    - [bugfix] Fixed expansion to respect character boundaries
+      (diewald)
+    - [bugfix] Fixed wrong behaviour of textual non-contexts in
+      snippet generation (diewald)
+    - [bugfix] Removed problematic serialization of empty
+      annotations (diewald)
+    - [feature] Serialize metadata keywords as arrays, when
+      indexed properly (may require reindexing; diewald)
+    - [feature] Serialize dates in dash separation format, when
+      metadata field name ends with "Date" (diewald)
+    - [bugfix] Fixed left exclusion-expansion when there is no 
+      more span for SpanOrQuery (margaretha)
+    - [bugfix] Fixed matchID response to be always identical to
+      a given matchID (diewald)
 
 0.56.1 2018-01-31
-        - [bugfix] Changed relation serialization in snippet to work
-          with segmented target anchors (diewald)
-          Warning: This is a breaking change!
+    - [bugfix] Changed relation serialization in snippet to work
+      with segmented target anchors (diewald)
+      Warning: This is a breaking change!
 
 0.55.9 2018-01-11
-        - [bugfix] Serialize token identifier correctly for
-          new corpora with text siglen (diewald)
-        - [bugfix] Extend bytebuffer for relation payloads (diewald)
-        - [bugfix] Wrong char offsets in snippet generation, where
-          repositioning can result in exceeding the string (diewald)
-        - [bugfix] Set correct start position of token-token-relations
-          in snippet generation (diewald)
-        - [bugfix] Token cannot contain another token or element (margaretha)
-        - [feature] Enabled searching relation query using regex (margaretha)
-        - [bugfix] Fix deserialization of negative regex in sequences (diewald)
-        - [cleanup] Upgraded Log4j to v2 (diewald)
+    - [bugfix] Serialize token identifier correctly for
+      new corpora with text siglen (diewald)
+    - [bugfix] Extend bytebuffer for relation payloads (diewald)
+    - [bugfix] Wrong char offsets in snippet generation, where
+      repositioning can result in exceeding the string (diewald)
+    - [bugfix] Set correct start position of token-token-relations
+      in snippet generation (diewald)
+    - [bugfix] Token cannot contain another token or element (margaretha)
+    - [feature] Enabled searching relation query using regex (margaretha)
+    - [bugfix] Fix deserialization of negative regex in sequences (diewald)
+    - [cleanup] Upgraded Log4j to v2 (diewald)
 
 0.55.8 2017-09-05
-        - [feature] Retrieve and display pagebreaks (diewald)
-        - [bugfix] Handle invalid dates in input (diewald)
-        - [feature] Support availability meta data (diewald)
-        - [bugfix] Do not respond with a "match all" VC if the
-          VC data (e.g. JSON) is wrong (diewald)
-        - [cleanup] Improved test suite for queries/VC with wildcards
-          and regexes (margaretha, diewald)
-        - [bugfix] Ignore zero-bit bitset segments in searching (diewald)
+    - [feature] Retrieve and display pagebreaks (diewald)
+    - [bugfix] Handle invalid dates in input (diewald)
+    - [feature] Support availability meta data (diewald)
+    - [bugfix] Do not respond with a "match all" VC if the
+      VC data (e.g. JSON) is wrong (diewald)
+    - [cleanup] Improved test suite for queries/VC with wildcards
+      and regexes (margaretha, diewald)
+    - [bugfix] Ignore zero-bit bitset segments in searching (diewald)
 
 0.55.7 2017-01-24
-        - [bugfix] Sorted results in unordered element distance query
-          results (margaretha)
-        - [bugfix] Throw error on optional operands in distance
-          queries (diewald)
-        - [performance] Remember solved problematic queries in the
-          query planner (diewald)
-        - [performance] Treat term queries like ".+?", ".+", ".*?", and ".*"
-          as any-terms (diewald)
-        - [feature] Introduced SpanExpansionQueryWrapper (diewald)
-        - [performance] Sequences of empty tokens will now be merged into
-          a single extension, if possible (diewald)
-        - [bugfix] Fixed paths in test suite for supporting
-          spaces (margaretha)
-        - [bugfix] Warn on empty elements in positional queries (diewald)
-        - [bugfix] Fix wrong deserialization test with negative element in
-          positional queries (diewald)
-        - [bugfix] Fix empty element match visualizations (diewald)
-        - [cleanup] Test indexer (margaretha)
-        - [feature] Improve indexer flags (margaretha)
-        - [bugfix] Improved Java8 compatibility (thomaskrause)
-        - [cleanup] Improved test suite for nested element distances
-          (margaretha)
-        - [bugfix] issue #16 (added skipTo in ElementDistanceSpan)
-          (margaretha)
-        - [bugfix] Fixed class ordering of highlights (diewald)
-        - [feature] warn on use of "operation:merge" (diewald)
+    - [bugfix] Sorted results in unordered element distance query
+      results (margaretha)
+    - [bugfix] Throw error on optional operands in distance
+      queries (diewald)
+    - [performance] Remember solved problematic queries in the
+      query planner (diewald)
+    - [performance] Treat term queries like ".+?", ".+", ".*?", and ".*"
+      as any-terms (diewald)
+    - [feature] Introduced SpanExpansionQueryWrapper (diewald)
+    - [performance] Sequences of empty tokens will now be merged into
+      a single extension, if possible (diewald)
+    - [bugfix] Fixed paths in test suite for supporting
+      spaces (margaretha)
+    - [bugfix] Warn on empty elements in positional queries (diewald)
+    - [bugfix] Fix wrong deserialization test with negative element in
+      positional queries (diewald)
+    - [bugfix] Fix empty element match visualizations (diewald)
+    - [cleanup] Test indexer (margaretha)
+    - [feature] Improve indexer flags (margaretha)
+    - [bugfix] Improved Java8 compatibility (thomaskrause)
+    - [cleanup] Improved test suite for nested element distances
+      (margaretha)
+    - [bugfix] issue #16 (added skipTo in ElementDistanceSpan)
+      (margaretha)
+    - [bugfix] Fixed class ordering of highlights (diewald)
+    - [feature] warn on use of "operation:merge" (diewald)
 
 0.55.6 2016-08-10
-        - [bugfix] distance with key "t" uses default foundry (diewald)
-        - [cleanup] Renamed fromJson() to fromKoral() (diewald)
-        - [cleanup] Removed deprecated methods in Krill:
-          setSpanQuery(), getRequest() (diewald)
-        - [cleanup] Removed deprecated method in KrillIndex:
-          search() (diewald)
-        - [documentation] Refer to KoralQuery instead of Koral (diewald)
-        - [cleanup] Removed deprecated method in KrillCollection:
-          getCount() (diewald)
-        - [feature] Added getDoc() method to KrillIndex (diewald)
-        - [bugfix] Fixed UID handling (diewald)
-        - [feature] Added document method to Web-API (diewald)
-        - [feature] Added experimental KrillStats class (diewald)
-        - [bugfix] Escape quotes in JSON strings (diewald)
-        - [bugfix] Escape XML and Brackets in snippets correctly (diewald)
-        - [feature] Differ between matching scope and match highlighting,
-          in case the match was extended to the sentence scope (diewald)
-        - [bugfix] KoralQuery bugs are now correctly moved to responses (diewald)
-        - [security] Do not mirror arbitrary JSON objects (diewald)
-        - [bugfix] Fixed zero-boundary repetition bug (diewald)
+    - [bugfix] distance with key "t" uses default foundry (diewald)
+    - [cleanup] Renamed fromJson() to fromKoral() (diewald)
+    - [cleanup] Removed deprecated methods in Krill:
+      setSpanQuery(), getRequest() (diewald)
+    - [cleanup] Removed deprecated method in KrillIndex:
+      search() (diewald)
+    - [documentation] Refer to KoralQuery instead of Koral (diewald)
+    - [cleanup] Removed deprecated method in KrillCollection:
+      getCount() (diewald)
+    - [feature] Added getDoc() method to KrillIndex (diewald)
+    - [bugfix] Fixed UID handling (diewald)
+    - [feature] Added document method to Web-API (diewald)
+    - [feature] Added experimental KrillStats class (diewald)
+    - [bugfix] Escape quotes in JSON strings (diewald)
+    - [bugfix] Escape XML and Brackets in snippets correctly (diewald)
+    - [feature] Differ between matching scope and match highlighting,
+      in case the match was extended to the sentence scope (diewald)
+    - [bugfix] KoralQuery bugs are now correctly moved to responses (diewald)
+    - [security] Do not mirror arbitrary JSON objects (diewald)
+    - [bugfix] Fixed zero-boundary repetition bug (diewald)
 
 0.55.5 2016-05-02
-        - [performance] Changed to a dynamic window for sorting in FocusSpans (margaretha)
-        - [bugfix] store skipped spans in Repetitionspans as candidates
-          (margaretha)
-        - [bugfix] Store lazy loading embedded spans for startsWith in
-          WithinSpans (diewald)
-        - [bugfix] Fixed loading krill.info in case krill.properties is given
-          (diewald)
-        - [bugfix] Remove element payloads in SubSpans (similar to Focus)
-          to prevent wrong highlighting (diewald)
-        - [bugfix] Sort SubSpans (margaretha)
+    - [performance] Changed to a dynamic window for sorting in FocusSpans (margaretha)
+    - [bugfix] store skipped spans in Repetitionspans as candidates
+      (margaretha)
+    - [bugfix] Store lazy loading embedded spans for startsWith in
+      WithinSpans (diewald)
+    - [bugfix] Fixed loading krill.info in case krill.properties is given
+      (diewald)
+    - [bugfix] Remove element payloads in SubSpans (similar to Focus)
+      to prevent wrong highlighting (diewald)
+    - [bugfix] Sort SubSpans (margaretha)
 
 0.55.4 2016-04-22
-        - [bugfix] Wrap <base/s=t> boundaries around right extended queries
-          (diewald)
-        - [bugfix] Lazy loading bug in WithinSpans (diewald)
-        - [feature] Matching relation nodes with attributes (margaretha)
-        - [bugfix] Removed span id in SegmentSpans, added in NextSpans (margaretha)
-        - [feature] Updated relation deserialization (margaretha)
-        - [feature] Added tests for relation queries and relation deserialization
-          (margaretha)
-        - [bugfix] Workaround for Nullpointers in SpanOrQuery (diewald)
+    - [bugfix] Wrap <base/s=t> boundaries around right extended queries
+      (diewald)
+    - [bugfix] Lazy loading bug in WithinSpans (diewald)
+    - [feature] Matching relation nodes with attributes (margaretha)
+    - [bugfix] Removed span id in SegmentSpans, added in NextSpans (margaretha)
+    - [feature] Updated relation deserialization (margaretha)
+    - [feature] Added tests for relation queries and relation deserialization
+      (margaretha)
+    - [bugfix] Workaround for Nullpointers in SpanOrQuery (diewald)
 
 0.55.3 2016-02-22
-        - [bugfix] Use base foundry for default sentences and paragraphs
-          (diewald, margaretha)
-        - [bugfix] Distance constraint exclusion serialized (diewald)
-        - [bugfix] Use indexer without krill.properties packaged (diewald)
-        - [bugfix] Clean pom.xml regarding overlapping dependencies (diewald)
+    - [bugfix] Use base foundry for default sentences and paragraphs
+      (diewald, margaretha)
+    - [bugfix] Distance constraint exclusion serialized (diewald)
+    - [bugfix] Use indexer without krill.properties packaged (diewald)
+    - [bugfix] Clean pom.xml regarding overlapping dependencies (diewald)
 
 0.55.2 2016-02-13
-        - [bugfix] Fixed support for corpus and doc IDs containing
-          dashes (diewald)
-        - [bugfix] Support "s" layer without meaning "surface" -
-          this is a hack (diewald)
+    - [bugfix] Fixed support for corpus and doc IDs containing
+      dashes (diewald)
+    - [bugfix] Support "s" layer without meaning "surface" -
+      this is a hack (diewald)
 
 0.55.1 2016-02-10
-        - [bugfix] Fixed attribute serialization in MatchInfo (diewald)
+    - [bugfix] Fixed attribute serialization in MatchInfo (diewald)
 
 0.55 2016-02-04
-        - [feature] Introducing payload identifiers to the index
-          structure (diewald, margaretha)
-          ! This is a major release, introducing index features  !
-          ! not compatible with indices of old versions of Krill !
+    - [feature] Introducing payload identifiers to the index
+      structure (diewald, margaretha)
+      ! This is a major release, introducing index features  !
+      ! not compatible with indices of old versions of Krill !
 
 0.54 2015-11-13
-        - [performance] Updated Lucene dependency from 4.10.3
-          to 5.0.0 (diewald)
-        - [bugfix] Minor fixes regarding invalid tokens in the
-          test suite (diewald)
-        - [bugfix] Fixed krill.properties test (diewald)
-        - [bugfix] Fixed multiple distances in disjunction query
-          (GitHub issue #2; margaretha)
+    - [performance] Updated Lucene dependency from 4.10.3
+      to 5.0.0 (diewald)
+    - [bugfix] Minor fixes regarding invalid tokens in the
+      test suite (diewald)
+    - [bugfix] Fixed krill.properties test (diewald)
+    - [bugfix] Fixed multiple distances in disjunction query
+      (GitHub issue #2; margaretha)
 
 0.53 2015-09-25
-        - [feature] Implemented new KrillCollection (diewald)
-          This should fix a lot of issues with deleted
-          documents and negation in virtual collections.
-        - [cleanup] REMOVED deprecated collection filtering (diewald)
-        - [cleanup] REMOVED deprecated termRelation API (diewald)
-        - [feature] Added removal methods for documents (diewald)
-        - [cleanup] REMOVED search method in KrillCollection (diewald)
-        - [bugfix] Fixed collection statistics (diewald)
-        - [feature] Improved packaging (diewald)
-        - [feature] Introduced cmd options for server (diewald)
-        - [feature] Return meta data on server-based indexation (diewald)
+    - [feature] Implemented new KrillCollection (diewald)
+      This should fix a lot of issues with deleted
+      documents and negation in virtual collections.
+    - [cleanup] REMOVED deprecated collection filtering (diewald)
+    - [cleanup] REMOVED deprecated termRelation API (diewald)
+    - [feature] Added removal methods for documents (diewald)
+    - [cleanup] REMOVED search method in KrillCollection (diewald)
+    - [bugfix] Fixed collection statistics (diewald)
+    - [feature] Improved packaging (diewald)
+    - [feature] Introduced cmd options for server (diewald)
+    - [feature] Return meta data on server-based indexation (diewald)
 
 0.52 2015-07-08
-        - [bugfix] Fixed payload filtering in FocusSpans (margaretha)
-        - [workaround] Reintroduced empty collection support,
-          as Koral still creates them (diewald)
-        - [bugfix] Escaped characters now supported in MutiTerm (diewald)
-        - [feature] Deserialization of flags (diewald)
-        - [feature] Made responses valid KoralQueries (diewald)
-        - [bugfix] Fixed sequence deserialization bug for simple unordered
-          constraint (diewald)
-        - [bugfix] Mirror collection (diewald)
-        - [bugfix] Updated default fields for meta data (diewald)
-        - [bugfix] Updated match identifier for "sigle" data (diewald)
-        - [workaround] Support corpusID/docID and textSigle match strings
-          (diewald)
-        - [workaround] Support matches starting with "contains"
-          (Kustvakt bug/diewald)
-        - [bugfix] Fixed treatment of several collection types (diewald)
-        - [bugfix] Remove legacy error handling in Match (diewald)
-        - [bugfix] JSON-serialization bug in match in case of
-          error messages (diewald)
-        - [bugfix] 'fields' serialization (diewald)
-        - [bugfix] Deserialization of group:disjunction (diewald)
-        - [bugfix] Deserialization of wrapped spans (diewald)
-        - [bugfix] Fix KoralQuery mirroring in case of
-          parsing failures (diewald)
-        - [feature] Support '@all' as a 'fields' value for all meta
-          data fields (diewald)
-        - [bugfix] Fix case sensitivity bug in filters (diewald)
-        - [bugfix] Fix sentence expansion bug for new data (diewald)
-        - [bugfix] Deserialization of 'containsnot' instead of 'excludes'
-          (diewald)
+    - [bugfix] Fixed payload filtering in FocusSpans (margaretha)
+    - [workaround] Reintroduced empty collection support,
+      as Koral still creates them (diewald)
+    - [bugfix] Escaped characters now supported in MutiTerm (diewald)
+    - [feature] Deserialization of flags (diewald)
+    - [feature] Made responses valid KoralQueries (diewald)
+    - [bugfix] Fixed sequence deserialization bug for simple unordered
+      constraint (diewald)
+    - [bugfix] Mirror collection (diewald)
+    - [bugfix] Updated default fields for meta data (diewald)
+    - [bugfix] Updated match identifier for "sigle" data (diewald)
+    - [workaround] Support corpusID/docID and textSigle match strings
+      (diewald)
+    - [workaround] Support matches starting with "contains"
+      (Kustvakt bug/diewald)
+    - [bugfix] Fixed treatment of several collection types (diewald)
+    - [bugfix] Remove legacy error handling in Match (diewald)
+    - [bugfix] JSON-serialization bug in match in case of
+      error messages (diewald)
+    - [bugfix] 'fields' serialization (diewald)
+    - [bugfix] Deserialization of group:disjunction (diewald)
+    - [bugfix] Deserialization of wrapped spans (diewald)
+    - [bugfix] Fix KoralQuery mirroring in case of
+      parsing failures (diewald)
+    - [feature] Support '@all' as a 'fields' value for all meta
+      data fields (diewald)
+    - [bugfix] Fix case sensitivity bug in filters (diewald)
+    - [bugfix] Fix sentence expansion bug for new data (diewald)
+    - [bugfix] Deserialization of 'containsnot' instead of 'excludes'
+      (diewald)
 
 0.51 2015-03-17
-        - This is a major version (prepared for the GitHub release)
-        - [cleanup] Changed groupID to "de.ids_mannheim.korap",
-          renamed korap-style.xml to Format.xml (diewald)
-        - [bugfix] Updated Format.xml to work with
-          recent versions of Eclipse (diewald)
-        - [documentation] Improved documentation for API classes (diewald)
-        - [bugfix] Updated AttributeSpans (margaretha)
-        - [bugfix] Updated SpanRelationQuery (margaretha)
-        - [cleanup] Autoformat (diewald)
-        - [documentation] References added to the Readme (diewald)
-        - [bugfix] Improved failing for missing property file (kupietz)
-        - [bugfix] Fixed tests for server responses to not use
-          Jackson deserialization (diewald)
-        - [cleanup] No more jersey logging in tests (diewald)
+    - This is a major version (prepared for the GitHub release)
+    - [cleanup] Changed groupID to "de.ids_mannheim.korap",
+      renamed korap-style.xml to Format.xml (diewald)
+    - [bugfix] Updated Format.xml to work with
+      recent versions of Eclipse (diewald)
+    - [documentation] Improved documentation for API classes (diewald)
+    - [bugfix] Updated AttributeSpans (margaretha)
+    - [bugfix] Updated SpanRelationQuery (margaretha)
+    - [cleanup] Autoformat (diewald)
+    - [documentation] References added to the Readme (diewald)
+    - [bugfix] Improved failing for missing property file (kupietz)
+    - [bugfix] Fixed tests for server responses to not use
+      Jackson deserialization (diewald)
+    - [cleanup] No more jersey logging in tests (diewald)
 
 0.50.1 2015-03-02
-        - [feature] Deserialization of arbitrary elements with
-          attributes (margaretha)
-        - [cleanup] Extracted KrillMeta from Krill,
-          renamed KorapQuery to KrillQuery,
-          extracted QueryBuilder from KrillQuery,
-          renamed KorapIndexer to index/Indexer,
-          renamed KorapDocument to model/AbstractDocument,
-          renamed KorapMatch to response/Match,
-          renamed KorapIndex to KrillIndex,
-          renamed KorapCollection to KrillCollection,
-          moved collector classes from index to response,
-          renamed KorapDate to KrillDate,
-          renamed KorapArray to KrillArray,
-          renamed KorapByte to KrillByte,
-          renamed KorapString to KrillString,
-          moved KorapNode to server/Node,
-          moved KorapResult to response/Result,
-          renamed KorapResponse to Response,
-          moved model/* to index,
-          moved meta/SearchContext to response/SearchContext,
-          krillified property files,
-          added Errorcodes,
-          removed KrillIndex#addDocFile (diewald)
-        - [documentation] Improved documentation for API classes (diewald)
+    - [feature] Deserialization of arbitrary elements with
+      attributes (margaretha)
+    - [cleanup] Extracted KrillMeta from Krill,
+      renamed KorapQuery to KrillQuery,
+      extracted QueryBuilder from KrillQuery,
+      renamed KorapIndexer to index/Indexer,
+      renamed KorapDocument to model/AbstractDocument,
+      renamed KorapMatch to response/Match,
+      renamed KorapIndex to KrillIndex,
+      renamed KorapCollection to KrillCollection,
+      moved collector classes from index to response,
+      renamed KorapDate to KrillDate,
+      renamed KorapArray to KrillArray,
+      renamed KorapByte to KrillByte,
+      renamed KorapString to KrillString,
+      moved KorapNode to server/Node,
+      moved KorapResult to response/Result,
+      renamed KorapResponse to Response,
+      moved model/* to index,
+      moved meta/SearchContext to response/SearchContext,
+      krillified property files,
+      added Errorcodes,
+      removed KrillIndex#addDocFile (diewald)
+    - [documentation] Improved documentation for API classes (diewald)
 
 0.50 2015-02-23
-        - Project name is now "Krill"
+    - Project name is now "Krill"
 
 0.49.4 2015-02-20
-        - [documentation] Improved documentation for API classes (diewald)
-        - [cleanup] Improved test coverage for utility classes (diewald)
-        - [performance] Updated Lucene dependency from 4.5.1 to 4.10.3,
-          Updated Jackson dependency from 2.4.0 to 2.4.4,
-          Updated Jersey dependency from 2.4.1 to 2.15 (diewald)
-        - [feature] Presorting of element terms in the index for coherent
-          SpanQuery sorting; Removed buffering of element candidates (diewald)
-          Warning: This is a breaking change!
-        - [feature] Added CorpusDataException to deal with data importing bugs;
-          made some imports break more easily though (diewald)
-        - [performance] Payloads in ElementSpans can now be lazily loaded,
-          MatchModifyClassSpans no longer rely on payload copies (diewald)
-        - [cleanup] Renamed /filter to /collection, 
-          merge KorapHTML and KorapString,
-          removed KorapSpan, KorapTermSpan and KorapLongSpan,
-          renamed /analysis to /model,
-          renamed shrink() to focus(),
-          removed KorapPrimaryData,
-          fixed a lot of wrong tests for WithinSpans,
-          renamed KorapFilter to /collection/CollectionBuilder,
-          renamed SpanMatchModify to SpanFocus,
-          changed KoralQuery root prefix to "koral",
-          renamed different kinds of "queries" throughout classes,
-          renamed KorapSearch#run to KorapSearch#apply (diewald)
-        - [feature] Improved deserialization of SpanSubSpanQueries
-          (margaretha)
-        - [feature] Introducing the potential need for resorting queries
-          on focussing (e.g., set by relations) (diewald)
-        - [bugfix] Hopefully fixing a resource related bug for
-          server instantiation (diewald)
-        - [bugfix] Changed attribute spans to contain element's
-          width (margaretha)
-        - [feature] Improved highlighting to use semantic html5 (#193; diewald)
+    - [documentation] Improved documentation for API classes (diewald)
+    - [cleanup] Improved test coverage for utility classes (diewald)
+    - [performance] Updated Lucene dependency from 4.5.1 to 4.10.3,
+      Updated Jackson dependency from 2.4.0 to 2.4.4,
+      Updated Jersey dependency from 2.4.1 to 2.15 (diewald)
+    - [feature] Presorting of element terms in the index for coherent
+      SpanQuery sorting; Removed buffering of element candidates (diewald)
+      Warning: This is a breaking change!
+    - [feature] Added CorpusDataException to deal with data importing bugs;
+      made some imports break more easily though (diewald)
+    - [performance] Payloads in ElementSpans can now be lazily loaded,
+      MatchModifyClassSpans no longer rely on payload copies (diewald)
+    - [cleanup] Renamed /filter to /collection, 
+      merge KorapHTML and KorapString,
+      removed KorapSpan, KorapTermSpan and KorapLongSpan,
+      renamed /analysis to /model,
+      renamed shrink() to focus(),
+      removed KorapPrimaryData,
+      fixed a lot of wrong tests for WithinSpans,
+      renamed KorapFilter to /collection/CollectionBuilder,
+      renamed SpanMatchModify to SpanFocus,
+      changed KoralQuery root prefix to "koral",
+      renamed different kinds of "queries" throughout classes,
+      renamed KorapSearch#run to KorapSearch#apply (diewald)
+    - [feature] Improved deserialization of SpanSubSpanQueries
+      (margaretha)
+    - [feature] Introducing the potential need for resorting queries
+      on focussing (e.g., set by relations) (diewald)
+    - [bugfix] Hopefully fixing a resource related bug for
+      server instantiation (diewald)
+    - [bugfix] Changed attribute spans to contain element's
+      width (margaretha)
+    - [feature] Improved highlighting to use semantic html5 (#193; diewald)
 
 0.49.3 2015-02-03
-        - [documentation] Improved documentation for
-          API classes (diewald)
-        - [documentation] Improved documentation for
-          various queries (margaretha)
-        - [feature] Added deserialization of SpanSubSpanQueries
-          (margaretha, diewald)
-        - [bugfix] Null filters are now correctly extended (diewald)
-        - [cleanup] Refactoring of KorapResult, KorapResponse, KorapQuery,
-          deprecated operation:or in favor of operation:junction,
-          updating test suite for class and frame attributes (diewald)
-        - [bugfix] Empty class segments are now correctly serialized
-          in sequences (diewald)
-        - [feature] Started support for position frames (diewald)
-        - [bugfix] Fixed #134 Nullpointer exception in WithinSpans
-          (diewald, margaretha)
+    - [documentation] Improved documentation for
+      API classes (diewald)
+    - [documentation] Improved documentation for
+      various queries (margaretha)
+    - [feature] Added deserialization of SpanSubSpanQueries
+      (margaretha, diewald)
+    - [bugfix] Null filters are now correctly extended (diewald)
+    - [cleanup] Refactoring of KorapResult, KorapResponse, KorapQuery,
+      deprecated operation:or in favor of operation:junction,
+      updating test suite for class and frame attributes (diewald)
+    - [bugfix] Empty class segments are now correctly serialized
+      in sequences (diewald)
+    - [feature] Started support for position frames (diewald)
+    - [bugfix] Fixed #134 Nullpointer exception in WithinSpans
+      (diewald, margaretha)
 
 0.49.2 2014-12-05
-        - [documentation] Improved documentation for
-          various queries (margaretha)
-        - [feature] Added @Experimental support (margaretha)
-        - [feature] Added Eclipse based code formatting (diewald)
+    - [documentation] Improved documentation for
+      various queries (margaretha)
+    - [feature] Added @Experimental support (margaretha)
+    - [feature] Added Eclipse based code formatting (diewald)
 
 0.49.1 2014-11-25
-        - [cleanup] Major refactoring for new response messages,
-          removed deprecated error messaging,
-          removed long-term deprecated methods in KorapResult,
-          removed long-term deprecated methods in KorapMatch,
-          renamed toJSON->toJsonString
-          renamed toJSONnode->toJsonNode,
-          renamed fromJSON->fromJson (diewald)
-        - [documentation] Improved documentation for notifications (diewald)
+    - [cleanup] Major refactoring for new response messages,
+      removed deprecated error messaging,
+      removed long-term deprecated methods in KorapResult,
+      removed long-term deprecated methods in KorapMatch,
+      renamed toJSON->toJsonString
+      renamed toJSONnode->toJsonNode,
+      renamed fromJSON->fromJson (diewald)
+    - [documentation] Improved documentation for notifications (diewald)
 
 0.49 2014-11-14
-        - This is a major version (prepared for the Evaluation Meeting)
-        - [bugfix] Rewrite works in repeating expansions (margaretha)
-        - [feature] Clean timeout with parameter support (diewald)
-        - [workaround] Support unknown overlap frame,
-          if frames are known (diewald)
-        - [bugfix] Class payload fixed in SpanRepetitions (margaretha)
-        - [bugfix] #179 Expansion bug fixed (margaretha)
-        - [bugfix] Corrected small bug where null warnings where
-          returned in JSON (diewald)
-        - [cleanup] Converted error to failure (diewald)
-        - [bugfix] Added const layer rewrite (diewald)
+    - This is a major version (prepared for the Evaluation Meeting)
+    - [bugfix] Rewrite works in repeating expansions (margaretha)
+    - [feature] Clean timeout with parameter support (diewald)
+    - [workaround] Support unknown overlap frame,
+      if frames are known (diewald)
+    - [bugfix] Class payload fixed in SpanRepetitions (margaretha)
+    - [bugfix] #179 Expansion bug fixed (margaretha)
+    - [bugfix] Corrected small bug where null warnings where
+      returned in JSON (diewald)
+    - [cleanup] Converted error to failure (diewald)
+    - [bugfix] Added const layer rewrite (diewald)
 
 0.48 2014-11-07
-        - This is a major version (prepared for the "Tag der Offenen Tür")
-        - [feature] Retrieval of token lists (diewald)
-        - [bugfix] Classes can now be highlighted to 127.
-        - [bugfix] Sequences with distances won't be flattened in
-          SpanSequenceQueryWrapper (diewald)
-        - [bugfix] Sequences with [problem][problem][anchor] can now
-          be deserialized (diewald)
-        - [bugfix] Queries with regular expressions in spanNext() are now
-          correctly rewritten (diewald)
-        - [bugfix] Ignore foundry for orth layer (diewald)
-        - [feature] Support fields in meta (diewald)
-        - [workaround] Support more legacy APIs (diewald)
-        - [bugfix] Check for the existence of @type in JSON-LD groups
-          to avoid NullPointer (diewald)
-        - [cleanup] Validated query and collection input - limited
-          to a "don't break anyting" policy (diewald)
+    - This is a major version (prepared for the "Tag der Offenen Tür")
+    - [feature] Retrieval of token lists (diewald)
+    - [bugfix] Classes can now be highlighted to 127.
+    - [bugfix] Sequences with distances won't be flattened in
+      SpanSequenceQueryWrapper (diewald)
+    - [bugfix] Sequences with [problem][problem][anchor] can now
+      be deserialized (diewald)
+    - [bugfix] Queries with regular expressions in spanNext() are now
+      correctly rewritten (diewald)
+    - [bugfix] Ignore foundry for orth layer (diewald)
+    - [feature] Support fields in meta (diewald)
+    - [workaround] Support more legacy APIs (diewald)
+    - [bugfix] Check for the existence of @type in JSON-LD groups
+      to avoid NullPointer (diewald)
+    - [cleanup] Validated query and collection input - limited
+      to a "don't break anyting" policy (diewald)
 
 0.47 2014-11-05
-        - [feature] Support new index format with more metadata (diewald)
-        - [bugfix] #142 Fixed class spans for skipTo() skips (margaretha)
-        - [feature] Added attribute support to relations (margaretha)
-        - [bugfix] Make classes and shrink default to 1 instead of 0 (diewald)
-        - [bugfix] shrink now removes all non-classes payloads (diewald)
+    - [feature] Support new index format with more metadata (diewald)
+    - [bugfix] #142 Fixed class spans for skipTo() skips (margaretha)
+    - [feature] Added attribute support to relations (margaretha)
+    - [bugfix] Make classes and shrink default to 1 instead of 0 (diewald)
+    - [bugfix] shrink now removes all non-classes payloads (diewald)
 
 0.46 2014-10-21
-        - [feature] Support for relation queries (margaretha)
-        - [feature] Wrapping of extension queries
-          (not completely tested yet; diewald)
+    - [feature] Support for relation queries (margaretha)
+    - [feature] Wrapping of extension queries
+      (not completely tested yet; diewald)
 
 0.45 2014-10-06
-        - [bugfix] Correctly respond request in JSON results (diewald)
-        - [cleanup] Made SpanQueryWrapper an abstract class instead
-          of an interface (diewald)
+    - [bugfix] Correctly respond request in JSON results (diewald)
+    - [cleanup] Made SpanQueryWrapper an abstract class instead
+      of an interface (diewald)
 
 0.44.1 2014-09-29
-        - [cleanup] Prepare test suite for publication (diewald)
+    - [cleanup] Prepare test suite for publication (diewald)
 
 0.44 2014-09-28
-        - [feature] Match collector using database for
-          distributed search (diewald)
-        - [bugfix] Unified boundary handling and prevent nullpointer
-          exceptions on parsing (diewald)
-        - [bugfix] Ordering of payloads reversed to make nesting highlights
-          nest correctly (diewald)
-        - [performance] Updated Lucene dependency from 4.3.1 to 4.5.1 (diewald)
-        - [performance] Updated Jackson dependency from 2.2.2 to 2.4.0 (diewald)
-        - [bugfix] Return matches correctly with JSON (diewald)
-        - [bugfix] Repare database tests working with temporary
-          databases (diewald)
+    - [feature] Match collector using database for
+      distributed search (diewald)
+    - [bugfix] Unified boundary handling and prevent nullpointer
+      exceptions on parsing (diewald)
+    - [bugfix] Ordering of payloads reversed to make nesting highlights
+      nest correctly (diewald)
+    - [performance] Updated Lucene dependency from 4.3.1 to 4.5.1 (diewald)
+    - [performance] Updated Jackson dependency from 2.2.2 to 2.4.0 (diewald)
+    - [bugfix] Return matches correctly with JSON (diewald)
+    - [bugfix] Repare database tests working with temporary
+      databases (diewald)
 
 0.43 2014-09-23
-        - [cleanup] Made a lot of stuff rely on KorapResponse (diewald)
-        - [bugfix] Small but ancient collection bug fixed (diewald)
-        - [feature] Collect first matches of documents based on UIDs (diewald)
+    - [cleanup] Made a lot of stuff rely on KorapResponse (diewald)
+    - [bugfix] Small but ancient collection bug fixed (diewald)
+    - [feature] Collect first matches of documents based on UIDs (diewald)
 
 0.42 2014-09-19
-        - [cleanup] Extracted private classes from KorapMatch (diewald)
-        - [bugfix] Fix query rewrite in contains-queries (diewald)
+    - [cleanup] Extracted private classes from KorapMatch (diewald)
+    - [bugfix] Fix query rewrite in contains-queries (diewald)
 
 0.41 2014-09-17
-        - [feature] getStartPos(classNr) and getEndPos(classNr)
-          in KorapMatch (diewald)
-        - [bugfix] SpanExpansionQuery with fixed Constructor
-          and Exclusion handling (margaretha)
-        - [feature] Early implementation of match collector (diewald)
+    - [feature] getStartPos(classNr) and getEndPos(classNr)
+      in KorapMatch (diewald)
+    - [bugfix] SpanExpansionQuery with fixed Constructor
+      and Exclusion handling (margaretha)
+    - [feature] Early implementation of match collector (diewald)
 
 0.40 2014-09-03
-        - [feature] Skeleton for standalone REST service (diewald)
+    - [feature] Skeleton for standalone REST service (diewald)
 
 0.33 2014-09-01
-        - [feature] SpanSubspanQuery (margaretha)
-        - [feature] SpanExpansionQuery (margaretha)
+    - [feature] SpanSubspanQuery (margaretha)
+    - [feature] SpanExpansionQuery (margaretha)
 
 0.32 2014-08-01
-        - [bugfix] Fix for repetition candidates (margaretha)
-        - [bugfix] Some fixes for negative segments (diewald)
-        - [bugfix] SpanMatchModify now skips in case the
-          requested class isn't found (diewald)
-        - [performance] Some logging issues fixed (diewald)
+    - [bugfix] Fix for repetition candidates (margaretha)
+    - [bugfix] Some fixes for negative segments (diewald)
+    - [bugfix] SpanMatchModify now skips in case the
+      requested class isn't found (diewald)
+    - [performance] Some logging issues fixed (diewald)
 
 0.31.8 2014-07-24
-        - [feature] Added optionality to querys for quantifiers (diewald)
-        - [feature] Support for korap:boundary deserialization (diewald)
+    - [feature] Added optionality to querys for quantifiers (diewald)
+    - [feature] Support for korap:boundary deserialization (diewald)
 
 0.31.7 2014-07-18
-        - [feature] Added warnings to responses (diewald)
+    - [feature] Added warnings to responses (diewald)
 
 0.31.6 2014-06-30
-        - [feature] Support for korap:reference deserialization (diewald)
-        - [feature] Preliminary support for attributes in elements (margaretha)
-        - [feature] Preliminary support operation:repetition deserialization
-          (unfinished and untested; diewald)
+    - [feature] Support for korap:reference deserialization (diewald)
+    - [feature] Preliminary support for attributes in elements (margaretha)
+    - [feature] Preliminary support operation:repetition deserialization
+      (unfinished and untested; diewald)
 
 0.31.5 2014-06-17
-        - [feature] Batch return of defined foundries and layers in
-          getMatchInfo() (diewald)
-        - [security] Improve foundry and layer check before injection in
-          regex (diewald)
+    - [feature] Batch return of defined foundries and layers in
+      getMatchInfo() (diewald)
+    - [security] Improve foundry and layer check before injection in
+      regex (diewald)
 
 0.31.4 2014-06-16
-        - [feature] MatchModifyClassQuery now can extend (diewald)
-        - [bugfix] Make matchinfo a bit more robust (diewald)
+    - [feature] MatchModifyClassQuery now can extend (diewald)
+    - [bugfix] Make matchinfo a bit more robust (diewald)
 
 0.31.3 2014-06-11
-        - [bugfix] Minor bugfix regarding treatment of
-          failed search results (diewald)
+    - [bugfix] Minor bugfix regarding treatment of
+      failed search results (diewald)
 
 0.31.2 2014-05-28
-        - [feature] Request parameter "itemsPerResource" limits
-          hits per document (diewald)
+    - [feature] Request parameter "itemsPerResource" limits
+      hits per document (diewald)
 
 0.31.1 2014-05-21
-        - [bugfix] Minor bugfix for wrongly serialized contexts
-          in responses (diewald)
+    - [bugfix] Minor bugfix for wrongly serialized contexts
+      in responses (diewald)
 
 0.31.0 2014-05-20
-        - [feature] span contexts in JSON-LD are now supported
-        - [bugfix] Multiple bugfixes regarding span context
-          extensions (diewald)
-        - [bugfix] Minor debugging bugs (diewald)
+    - [feature] span contexts in JSON-LD are now supported
+    - [bugfix] Multiple bugfixes regarding span context
+      extensions (diewald)
+    - [bugfix] Minor debugging bugs (diewald)
 
 0.30.9 2014-04-11
-        - [bugfix] Prevent multiple identifiers in
-          relation highlighting (diewald)
+    - [bugfix] Prevent multiple identifiers in
+      relation highlighting (diewald)
 
 0.30.8 2014-04-10
-        - Added getTermRelationJSON() to KorapCollection (diewald)
-          This is likely to get deprecated!
+    - Added getTermRelationJSON() to KorapCollection (diewald)
+      This is likely to get deprecated!
 
 0.30.7 2014-04-09
-        - Moved JSON interpretation from BooleanFilter to KorapFilter (diewald)
-        - Added 'or' and group nesting to KorapFilter (diewald)
+    - Moved JSON interpretation from BooleanFilter to KorapFilter (diewald)
+    - Added 'or' and group nesting to KorapFilter (diewald)
 
 0.30.6 2014-03-20
-        - Refactoring and cleaning of ElementSpans (diewald)
-        - [bugfix] Stabilizing KorapMatch (diewald)
+    - Refactoring and cleaning of ElementSpans (diewald)
+    - [bugfix] Stabilizing KorapMatch (diewald)
 
 0.30.5 2014-03-18
-        - Support for Quantifier Queries (margaretha)
-        - Some benchmarks (margaretha)
-        - [bugfix] WithinSpans respect match payloads,
-          and are now way more correct ;) (diewald)
-        - Support for overlap queries (diewald)
-        - Refactoring of WithinSpans (diewald)
-        - Introducing lazy loading for wrapper .end() in WithinSpans (diewald)
+    - Support for Quantifier Queries (margaretha)
+    - Some benchmarks (margaretha)
+    - [bugfix] WithinSpans respect match payloads,
+      and are now way more correct ;) (diewald)
+    - Support for overlap queries (diewald)
+    - Refactoring of WithinSpans (diewald)
+    - Introducing lazy loading for wrapper .end() in WithinSpans (diewald)
 
 0.30.4 2014-02-26
-        - [cleanup] Making MultiTerm* more robust (diewald)
+    - [cleanup] Making MultiTerm* more robust (diewald)
 
 0.30.3 2014-02-20
-        - Return json request in response if given (diewald)
-        - [bugfix] ClassSpans and WithinSpans check skipTo
-          in advance now (diewald)
-        - Compilerfriendly logging rules, resulting
-          in significant performance improvements (diewald)
-        - Small refactorings (diewald)
+    - Return json request in response if given (diewald)
+    - [bugfix] ClassSpans and WithinSpans check skipTo
+      in advance now (diewald)
+    - Compilerfriendly logging rules, resulting
+      in significant performance improvements (diewald)
+    - Small refactorings (diewald)
 
 0.30.2 2014-02-14
-        - [bugfix] wrapper uses correct distance constraint (diewald)
+    - [bugfix] wrapper uses correct distance constraint (diewald)
 
 0.30.1 2014-02-13
-        - Added sentence extension for match info (diewald)
+    - Added sentence extension for match info (diewald)
 
 0.30 2014-02-13
-        - This is a major version
-          (prepared for the IDS meeting on the 17th of february)
-        - Improved stringification for distance queries (margaretha)
+    - This is a major version
+      (prepared for the IDS meeting on the 17th of february)
+    - Improved stringification for distance queries (margaretha)
 
 0.26.4 2014-02-12
-        - Serialize SpanDistanceQueries and SpanMultipleDistanceQueries
-          (diewald)
-        - [temporarily] Added default foundry "mate" in KorapQuery (diewald)
+    - Serialize SpanDistanceQueries and SpanMultipleDistanceQueries
+      (diewald)
+    - [temporarily] Added default foundry "mate" in KorapQuery (diewald)
 
 0.26.3 2014-02-12
-        - [bugfix] Only open writer in case it's needed (diewald)
+    - [bugfix] Only open writer in case it's needed (diewald)
 
 0.26.2 2014-02-12
-        - Added sequence queries with defined gaps (margaretha)
-        - Support for multiple distance constraints (margaretha)
-        - Updated json-ld deserialization with nested meta (diewald)
-        - [bugfix] Wildcards in segments were ignored (diewald)
+    - Added sequence queries with defined gaps (margaretha)
+    - Support for multiple distance constraints (margaretha)
+    - Updated json-ld deserialization with nested meta (diewald)
+    - [bugfix] Wildcards in segments were ignored (diewald)
 
 0.26.1 2014-01-21
-        - Distinct Match retrieval including spans
-          and dependency relations (diewald)
+    - Distinct Match retrieval including spans
+      and dependency relations (diewald)
 
 0.26 2014-01-16
-        - Introduced standalone SpanSegmentQueries (margaretha)
-        - [bugfix] SpanNextQueries (margaretha)
-        - Support for Match Identifiers (diewald)
-        - Support for distinct Match retrieval (diewald)
+    - Introduced standalone SpanSegmentQueries (margaretha)
+    - [bugfix] SpanNextQueries (margaretha)
+    - Support for Match Identifiers (diewald)
+    - Support for distinct Match retrieval (diewald)
 
 0.25.3 2014-01-10
-        - Updated Lucene to 4.3.1 (diewald)
-        - Welcome! Eliza Margaretha has joined the team!
+    - Updated Lucene to 4.3.1 (diewald)
+    - Welcome! Eliza Margaretha has joined the team!
 
 0.25.2 2013-12-29
-        - Fixed highlight bug with empty reopened tags
+    - Fixed highlight bug with empty reopened tags
 
 0.25.1 2013-12-28
-        - Support for pubDate collections
-        - Changed versioning scheme
+    - Support for pubDate collections
+    - Changed versioning scheme
 
 0.25 2013-12-20
-        - Support for Wildcard Queries
-        - Improved support for regular expressions
-        - Introduced keyword fields that store no positions
+    - Support for Wildcard Queries
+    - Improved support for regular expressions
+    - Introduced keyword fields that store no positions
 
 0.24_1 2013-12-05
-        - This is a pseudo version for demo versions with dirty hacks,
-          meant to be rolled back!
-        - There is now an ignored broken test in TestKorapCollection
+    - This is a pseudo version for demo versions with dirty hacks,
+      meant to be rolled back!
+    - There is now an ignored broken test in TestKorapCollection
 
 0.24 2013-12-05
-        - Json deserializer finished for virtual collections
+    - Json deserializer finished for virtual collections
 
 0.23 2013-12-05
-        - Error handling corrected in KorapResult
-        - Json deserializer finished for queries
+    - Error handling corrected in KorapResult
+    - Json deserializer finished for queries
 
 0.22 2013-12-04
-        - Introduced KorapSearch
-        - Json deserializer (started)
+    - Introduced KorapSearch
+    - Json deserializer (started)
 
 0.21 2013-11-28
-        - Virtual collections can now be defined,
-          searched, nested and extended
+    - Virtual collections can now be defined,
+      searched, nested and extended
 
 0.20 2013-11-18
-        - Unboxing from sandbox repository
+    - Unboxing from sandbox repository
 
 0.11 2013-11-14
-        - JSON file importer (plain and gzip)
-        - [bugfix] Element Query
-        - [bugfix] Sequence Query
+    - JSON file importer (plain and gzip)
+    - [bugfix] Element Query
+    - [bugfix] Sequence Query
 
 0.10 2013-11-11
-        - Added JSON input to indexer
+    - Added JSON input to indexer
 
 0.09 2013-11-07
-        - Reconstruction of all wrapper queries using an interface
-        - Finished KorapQuery (preliminary feature freeze)
+    - Reconstruction of all wrapper queries using an interface
+    - Finished KorapQuery (preliminary feature freeze)
 
 0.08 2013-10-18
-        - Changed methods to attributes in KorapMatch
-        - Changed SimpleJSON to Jackson
-        - Fixed Highlighting
-        - Some Refactoring of result classes
-        - Introduced KorapDocument
-        - Introduced KorapHTML utility
+    - Changed methods to attributes in KorapMatch
+    - Changed SimpleJSON to Jackson
+    - Fixed Highlighting
+    - Some Refactoring of result classes
+    - Introduced KorapDocument
+    - Introduced KorapHTML utility
 
 0.07 2013-10-14
-        - Added position to offset matching
+    - Added position to offset matching
 
 0.06 2013-10-01
-        - Added SpanElementQuery for working WithinQeries
-        - Added KorapResult and KorapMatching
+    - Added SpanElementQuery for working WithinQeries
+    - Added KorapResult and KorapMatching
 
 0.05 2013-09-18
-        - Fixed bug in indexing (MultiTermTokenStream)
-        - Fixed SpanNext
-        - Added KorapIndex
-        - First draft for KorapFilter
+    - Fixed bug in indexing (MultiTermTokenStream)
+    - Fixed SpanNext
+    - Added KorapIndex
+    - First draft for KorapFilter
 
 0.04 2013-09-01
-        - Introduced optimized SpanNext class (not working atm),
-          as SpanNear does not always work with nested synonyms
+    - Introduced optimized SpanNext class (not working atm),
+      as SpanNear does not always work with nested synonyms
 
 0.03 2013-08-28
-        - Added within query (not working atm)
-        - Pushed query part to public repo
+    - Added within query (not working atm)
+    - Pushed query part to public repo
 
 0.02 2013-08-26
-        - Added sequences
+    - Added sequences
 
 0.01 2013-08-20
-        - First version as maven build environment
+    - First version as maven build environment
diff --git a/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java b/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
index db0d675..24ce0b0 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
@@ -7,7 +7,8 @@
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.util.Bits;
 
-/** Filter for virtual corpus/collection existing in the cache.
+/**
+ * Filter for virtual corpus/collection existing in the cache.
  * 
  * @author margaretha
  *
@@ -15,7 +16,7 @@
 public class CachedVCFilter extends Filter {
 
     private CachedVCData cachedCollection;
-    
+
     public CachedVCFilter (CachedVCData cachedCollection) {
         this.cachedCollection = cachedCollection;
     }
@@ -23,7 +24,12 @@
     @Override
     public DocIdSet getDocIdSet (LeafReaderContext context, Bits acceptDocs)
             throws IOException {
-        DocBits docBits = cachedCollection.getDocIdMap().get(context.hashCode());
+        DocBits docBits =
+                cachedCollection.getDocIdMap().get(context.hashCode());
+        if (docBits == null) {
+            // does not exist in the cache
+            return null;
+        }
         return docBits.createBitDocIdSet();
     }