Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-203

Earlier metadata extraction in ParsingReader

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.3
    • parser
    • None

    Description

      The normal parse() method guarantees that all extracted metadata will be available in the metadata object once the method returns. But since the ParsingReader class runs the parse() method in a background thread, one can only assume that extracted metadata is available once the entire character stream has been consumed. This is troublesome for example when creating Lucene Document objects, as Lucene postpones reading the given character stream to when the already constructed Document is passed to an IndexWriter. The result is that (depending on thread scheduling and the structure of the input document format) metadata may not be available for inclusion in the indexed Document.

      One way of fixing this issue is to add a small character buffer in ParsingReader, and to make sure that the buffer is filled with extracted text before the ParsingReader constructor returns. This should ensure that relevant document metadata is almost always available, since the majority of document formats have all or most metadata at the beginning of the document stream.

      Attachments

        1. lipsum.doc
          53 kB
          Daan de Wit

        Issue Links

          Activity

            People

              jukkaz Jukka Zitting
              jukkaz Jukka Zitting
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: