用码头启动 Solr
Start Solr with jetty
我有一个示例代码java,可以使用Solr搜索我的索引数据。
public class SimpleSolr
{
public static void main(String[] args) throws MalformedURLException, SolrServerException
{
HttpSolrServer solr = new HttpSolrServer("http://localhost:8983/solr");
// http://localhost:8983/solr/spellCheckCompRH?q=epod&spellcheck=on&spellcheck.build=true
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/select");
params.set("q", "international");
params.set("wt", "xml");
//params.set("spellcheck.build", "true");
QueryResponse response = solr.query(params);
System.out.println("response = " + response);
}
}
但是在执行此客户端应用程序之前,我需要使用此命令启动我的 solr
java -jar start.jar
我需要自动启动我的 solr 服务器。
我该怎么做?
我需要知道从我的 C++ 应用程序与我的 solr 服务器通信的 bset 方式是什么?
谢谢。
要在启动时运行 solr 服务器,您可能需要查看以下线程: https://superuser.com/questions/685471/how-can-i-run-a-command-after-boot
要从C++应用程序与Solr服务器进行通信,最简单的方法是通过在查询中添加&wt=json
来使用服务器的json api。
http://localhost:8983/solr/your_core/select?q={!dismax}&wt=json&indent=true
然后,您可以使用优秀的 JsonCPP (https://github.com/open-source-parsers/jsoncpp) 解析收到的 json。
相关文章:
- 如何创建一个空的全局类并在启动时实例化它
- 即使我读取了所有内容,在FIFO上打开的QSocketNotifier也会一直启动
- 使用 std::string () const 函数启动线程或未来
- 如何修复valgrind启动时的致命错误(与libc6-dbg和libc6-dbg:i386连接)
- 将向量作为类>(值)<向量启动和向量<类>[值]有什么区别
- 如何创建线程序列以按照启动顺序执行任务?
- WINAPI 注册应用程序重新启动时不清除打开的套接字
- 在挂钩启动新线程时解除挂钩进程
- 程序无法启动,因为缺少 libmpc-3.dll
- 从 exe 文件 (Visual Studio ) 启动时调试断言失败
- QSerialPort 在应用程序启动之前正在使用中
- 无法在 Arch Linux 中启动虚幻引擎 4
- C++关于指针和使用函数将它们启动到堆的行为究竟是什么?
- 如何使用 ctypes 停止和重新启动从 Python 运行的C++代码
- 程序在使用 system() 启动另一个可执行文件时停止
- Qt 和 Android - 如何使用 Qandroidjniobject 启动相机
- Q没有管理权限的 exe 无法启动维护工具
- 启动类函数作为失去引用的线程
- 如何使用C++确定应用程序是否已在窗口中启动?
- 用码头启动 Solr