Mongo连接器未运行以在Apache Solr中创建索引

时间:2018-01-02 17:40:44

标签: python mongodb indexing solr lucene

我正在尝试索引存储在Mongo DB集合中的数据。我按照以下链接执行此操作:

https://www.toadworld.com/platforms/nosql/b/weblog/archive/2017/02/03/indexing-mongodb-data-in-apache-solr

但是当我使用这个命令启动mongo-connector时,它说:

Traceback (most recent call last):
  File "/usr/local/bin/mongo-connector", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/mongo_connector/util.py", line 104, in wrapped
    func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mongo_connector/connector.py", line 1275, in main
    conf.parse_args()
  File "/usr/local/lib/python2.7/dist-packages/mongo_connector/config.py", line 106, in parse_args
    + ', '.join(args))
mongo_connector.errors.InvalidConfiguration: The following command line arguments are not recognized: –n, database1.collection1

命令:

root@workstation:/var/lib/mongodb# mongo-connector --unique-key=_id  -m localhost:27017 -t http://localhost:8983/solr/wlslog -d solr_doc_manager –n database1.collection1

如果-n无效,那么我应该使用什么来指向数据库?我已经在网上搜索但是无法获得任何有用的东西。有人可以帮忙吗?我是Solr的新手。这可能是由于python / mongoDB / mongoConnector / Solr的版本不兼容而发生的吗?

1 个答案:

答案 0 :(得分:0)

您的命令无效:–n database1.collection1。使用“ -n”而不是“ -n”。