Getting Started with Lucene 3.6.2 (Tika)

Source: Internet
Author: User
Tags create index createindex

The first thing to post is a demo of Hellotikaindex.java using Tika to create an index.

PS: About the introduction and usage of Tika, as detailed in the Hellotika.java below

Package com.jadyer.lucene;  
Import Java.io.File;  
      
Import java.io.IOException;  
Import org.apache.lucene.document.Document;  
Import Org.apache.lucene.document.Field;  
Import Org.apache.lucene.index.IndexReader;  
Import Org.apache.lucene.index.IndexWriter;  
Import Org.apache.lucene.index.IndexWriterConfig;  
Import Org.apache.lucene.index.Term;  
Import Org.apache.lucene.search.IndexSearcher;  
Import Org.apache.lucene.search.Query;  
Import Org.apache.lucene.search.ScoreDoc;  
Import Org.apache.lucene.search.TermQuery;  
Import Org.apache.lucene.search.TopDocs;  
Import Org.apache.lucene.store.Directory;  
Import Org.apache.lucene.store.FSDirectory;  
Import org.apache.lucene.util.Version;  
      
Import Org.apache.tika.Tika;  
      
Import Com.chenlb.mmseg4j.analysis.ComplexAnalyzer; 
 /** * "Lucene3.6.2 Introductory series" 10th _tika * @create Aug, 2013 11:02:21 PM * @author Xuan Yu  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.