I suppose you can get them in highlighting job.
Store all the text in the document's field.And use Highlighter.getBestFragment() to get what you want.
Remember calling Highlighter.setTextFragmenter(new SimpleFragmenter(50)) first,it would restrict the return words' length into 50.