[英]how to import specified collection data using mongo connector
I am importing data from mongodb 3.4.6 to solr 7.6.0 all of data is imported but i need to import from some specified database to some collections only not all of the data. 我正在将数据从mongodb 3.4.6导入到solr 7.6.0中,所有数据均已导入,但我需要从某些指定的数据库中导入到某些集合中,而不是所有数据。 and i want to get only some specified fields from the collection.
我只想从集合中获取一些指定的字段。 how to import in that manner please tell us.
如何以这种方式导入,请告诉我们。
Depending on your version of mongo-connector, you can either use the -n
parameter (pre 2.5.0), or the namespaces
configuration setting (2.5.0+): 根据您的mongo-connector版本,您可以使用
-n
参数(2.5.0之前的版本),也可以使用namespaces
配置设置 (2.5.0+):
namespaces
Default: Include all namespaces except system and GridFS collections.namespaces
默认值:包括除系统和GridFS集合以外的所有名称空间。NEW in 2.5.0: The namespaces configuration option is used to control how and which MongoDB namespaces are replicated.
2.5.0中的新增功能:名称空间配置选项用于控制复制方式和复制MongoDB名称空间的方式。 By default, Mongo Connector will replicate all namespaces except for system and GridFS collections.
默认情况下,Mongo Connector将复制除系统和GridFS集合以外的所有名称空间。 Namespaces should be given as database_name.collection_name.
命名空间应指定为database_name.collection_name。 Each namespace may contain a single wildcard ( ) which matches any characters.
每个名称空间都可以包含一个与任何字符匹配的通配符( )。 For example, db_ .foo matches db_bar.foo and db_a.foo.
例如,db_ .foo与db_bar.foo和db_a.foo匹配。
You tell mongo-connector
which configuration to use with the -c
parameter: 您可以通过
-c
参数告诉mongo-connector
使用哪种配置:
mongo-connector -c config.json
To index into a specific collection, give the collection name to the -t
parameter : 要索引到特定集合中, 请将集合名称赋予
-t
参数 :
-t http://localhost:8983/solr/MyCore
To only index specific fields, use the fields
configuration option or the -i
command line argument. 要仅索引特定字段,请使用
fields
配置选项或-i
命令行参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.