Split the data into 2 fields, timestamp and content. Store one lucene document per line with the 2 fields, timestamp stored and not indexed (unless you want to search on it), content stored and analyzed. Use StandardAnalyzer unless you have special requirements.
Then close the IndexWriter, open a searcher, use QueryParser to get a query for "content: some message", search, get and display the timestamp and content fields and you're done. Googling "lucene tutorial" or "lucene getting started" will get hits. Or look at the sample/demo code at http://lucene.apache.org/core/quickstart.html. Or, best of all, get hold of a copy of Lucene In Action 2nd. edition. Or take a look at Solr. -- Ian. On Fri, Jul 6, 2012 at 4:16 AM, sam <hairen...@yahoo.com.cn> wrote: > I want seach a txt ,which is store like <2012-07-06 11:11:43 some > message> at one line .How to seach that,I need get the time and content. > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/about-some-seacher-I-m-new-hand-thank-you-for-help-tp3993397.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org