douyue5856 2013-02-04 20:02
浏览 348

如何通过Elastica使用ES插件MongoDB河将MongoDB与Elastic Search连接起来

i'm new to programming, so i apologize, if my question is very simple.

First of all, I have installed and configured MongoDB and ES with MongoDB river, but i can't find how to do it via Elastica. My example is

curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{ 
"type": "mongodb", 
"mongodb": { 
    "db": "testTweets", 
    "collection": "msgs"
}, 
"index": {
    "name": "mongoindex", 
    "type": "my_type" 
}
}'

and also a query is

curl -XGET 'http://localhost:9200/mongoindex/_search?q=something&pretty=true'

How can i write them using PHP and Elastica?

I took as example

$elasticaType = $elasticaIndex->getType('tweet');

and i can't find how to match the curl command with the right php code.

I hope to be crystal clear! If you need any other to detail to give my a help, i will be very happy to add it.

Thank you in advance!

EDIT***

A nice way to compose ElasticSearch analysis or mapping is the following chrome extension https://chrome.google.com/webstore/detail/sense/doinijnbnggojdlcjifpdckfokbbfpbo . It's very helpful for me.

  • 写回答

1条回答 默认 最新

  • doxzrb8721 2014-02-05 14:11
    关注

    I believe the only way is to do it VIA PHP CURL ..

    评论

报告相同问题?

悬赏问题

  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python