首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 运行在App引擎Lucene

运行在App引擎Lucene

  • 资源大小:9.25 MB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: lucene app 引擎 运行

资 源 简 介

Introduction Run Lucene in App Engine. Example: http://lucene-gae-example.appspot.com/ Index Index texts in Lucene just like in the FileSystem Directory. ``` public class IndexServlet extends HttpServlet { private static final Version VERSION = Version.LUCENE_34; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String text = req.getParameter("text"); DataStoreDirectory directory = new DataStoreDirectory(); IndexWriterConfig iwc = new IndexWriterConfig(VERSION, new StandardAnalyzer(VERSION)); iwc.setMergeScheduler(new SerialMergeScheduler()); IndexWriter writer = new IndexWriter(directory, iwc); Document doc = new Document(); doc.add(new Field("text", text, Field.Store.YES, Field.Index.ANALYZED)); writer.addDocument(doc); writer.close(); } } ``` Search
VIP VIP
0.171348s