是否有Lucene搜索引擎(Not Solr)REST API用于查询索引内容? [英] Has lucene search engine (Not Solr) REST API for querying the indexed content?

查看:76
本文介绍了是否有Lucene搜索引擎(Not Solr)REST API用于查询索引内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Lucene中查询索引内容.我们是否需要编写任何脚本或任何可用的api来查询索引.

How to query the indexed content in Lucene. Do we need to write any script or any api's available to query the index.

推荐答案

如何在Lucene中查询索引内容?您可以使用Lucene API的ÌndexReaderÌndexSearcher类编写Java类.您需要构建查询并将其作为参数传递给搜索器实例.没有自动REST点.

How to query the indexed content in Lucene? You write a Java class using ÌndexReader and ÌndexSearcher classes of Lucene API. You need to build a query and pass on to searcher instance as parameter. There is no automatic REST point.

Lucene只是一个API,最初是Java语言,后来又移植到了 .NET ,因此您可以使用Java或C#开发索引创建器以及索引搜索器程序.

Lucene is simply an API, originally in Java then later ported to.NET too so either you can use Java or C# to develop your index creator as well as index searcher programs.

您的搜索器代码最终将是Java类,而您-程序员可能希望通过REST端点公开搜索逻辑.Lucene不提供任何现成的东西.

Your searcher code will eventually be a Java Class and it is you - the programmer who might wish to expose search logic via a REST End Point. Lucene doesn't provide any off the shelf things like that.

IndexReader IndexSearcher 是主要的用于搜索索引的Java类.

IndexReader and IndexSearcher are main Java classes for searching an index.

Lucene API从一个版本到另一个版本的更改很大,因此请仅查找所选版本的代码示例.

Lucene API changes heavily from one version to another so look for code examples for only your chosen version.

按照该

As per accepted answer of this SO Question, its possible to search a lucene index with SOLR. I have personally not performed that kind of search though.

这篇关于是否有Lucene搜索引擎(Not Solr)REST API用于查询索引内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆