I just checked the API documentation, and it says:

Class MultiFields
public static Bits getLiveDocs(IndexReader reader)
Returns a single Bits instance for this reader, merging live Documents
on the fly. This method will return null if the reader has no
deletions.

Should there be a check for null?

On Fri, Jun 27, 2014 at 11:40 AM, Jose Blanco <[email protected]> wrote:
> I just ran index-lucene-init and it completed successfully, but when I
> try to run
>
> index-lucene-update, it blows up at where I have (****):
>
>      */
>     public static void cleanIndex(Context context) throws IOException,
> SQLException {
>
>     IndexReader reader = DSQuery.getIndexReader();
>
>     Bits liveDocs = MultiFields.getLiveDocs(reader);
>
>     for(int i = 0 ; i < reader.numDocs(); i++)
>     {
> (****)       if (!liveDocs.get(i))
>
>
> The error I'm getting is
>
> Exception: null
> java.lang.NullPointerException
>         at org.dspace.search.DSIndexer.cleanIndex(DSIndexer.java:616)
>
> I know reader is not null, but liveDocs must be, but why?
>
> -Jose

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to