solr 简要笔记

创建搜索
1 创建directory
2.分词器 analyzer
3indexwriter writer dic an
4.document doc.add

writer.adddocument(doc)

2.查询
indexSearcher searcher =new IndexSearch(dir)
query q =queryparse.parse
hit hits=searcher.searcher(q)
q.close

posted @ 2018-12-28 14:46  左手编程右手诗  阅读(150)  评论(0编辑  收藏  举报