【问题标题】:Limit mongo-connector to a specific collection for Solr indexing将 mongo-connector 限制为 Solr 索引的特定集合
【发布时间】:2014-07-24 14:26:23
【问题描述】:

我目前正在尝试使用 mongo-connector 自动将数据库更新提供给 Solr。通过使用以下命令可以正常工作 -

mongo-connector -m localhost:27017 -t http://localhost:8983/solr -d mongo_connector/doc_managers/solr_doc_manager.py

但是,它正在索引我的 mongodb 中的每个集合。我已经尝试通过以下方式使用 -n 选项 -

mongo-connector -m localhost:27017 -t http://localhost:8983/solr -n feed_scraper_development.articles -d mongo_connector/doc_managers/solr_doc_manager.py

这会失败并出现以下错误 -

2014-07-24 22:23:23,053 - INFO - Beginning Mongo Connector
2014-07-24 22:23:23,104 - INFO - Starting new HTTP connection (1): localhost
2014-07-24 22:23:23,110 - INFO - Finished 'http://localhost:8983/solr/admin/luke?show=schema&wt=json' (get) with body '' in 0.018 seconds.
2014-07-24 22:23:23,115 - INFO - OplogThread: Initializing oplog thread
2014-07-24 22:23:23,116 - INFO - MongoConnector: Starting connection thread MongoClient('localhost', 27017)
2014-07-24 22:23:23,126 - INFO - Finished 'http://localhost:8983/solr/update/?commit=true' (post) with body 'u'<commit ' in 0.006 seconds.
2014-07-24 22:23:23,129 - INFO - Finished 'http://localhost:8983/solr/select/?q=%2A%3A%2A&sort=_ts+desc&rows=1&wt=json' (get) with body '' in 0.003 seconds.
2014-07-24 22:23:23,337 - INFO - Finished 'http://localhost:8983/solr/select/?q=_ts%3A+%5B6038164010275176560+TO+6038164010275176560%5D&rows=100000000&wt=json' (get) with body '' in 0.207 seconds.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
    self.run()
  File "build/bdist.macosx-10.9-intel/egg/mongo_connector/oplog_manager.py", line 141, in run
    cursor = self.init_cursor()
  File "build/bdist.macosx-10.9-intel/egg/mongo_connector/oplog_manager.py", line 582, in init_cursor
    cursor = self.get_oplog_cursor(timestamp)
  File "build/bdist.macosx-10.9-intel/egg/mongo_connector/oplog_manager.py", line 361, in get_oplog_cursor
    timestamp = self.rollback()
  File "build/bdist.macosx-10.9-intel/egg/mongo_connector/oplog_manager.py", line 664, in rollback
    if doc['ns'] in rollback_set:
KeyError: 'ns'

任何帮助或线索将不胜感激!

额外信息:Solr 4.9.0 | MongoDB 2.6.3 | mongo-connector 1.2.1

【问题讨论】:

  • 请问,您在哪个文档中找到了 -n 选项?

标签: mongodb solr indexing connector


【解决方案1】:

在删除数据文件夹中的所有索引,重新启动 solr 并使用 -n 选项重新运行命令后,它可以像宣传的那样工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-05
    • 1970-01-01
    • 1970-01-01
    • 2013-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多