有没有办法克服Solr的局限性
Is there a way to overcome the limitation of Solr
有没有办法克服Solr的限制
如何向我已经创建并包含数千万数据的集合添加额外的列。
要向现有架构添加新字段,您可以使用 Solr Schema API:
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"sell_by",
"type":"pdate",
"stored":true }
}' http://localhost:8983/solr/gettingstarted/schema
type
参数对应于您希望新字段具有的字段类型。
如果您是 using the old schema.xml format,您可以在 XML 中添加字段类型:
<field name="sell_by" type="pdate" indexed="true" stored="true"/>
您必须在更改后重新加载集合的配置。如果您正在使用 Zookeeper(即您手动将配置上传到 Zookeeper),您可以use zkCli.sh
and downconfig
and upconfig
下载和上传配置集。
添加字段后,您必须重新索引应包含该字段的文档,方法是再次将它们提交给 Solr,以便按预期将内容添加到字段中。
有没有办法克服Solr的限制
如何向我已经创建并包含数千万数据的集合添加额外的列。
要向现有架构添加新字段,您可以使用 Solr Schema API:
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"sell_by",
"type":"pdate",
"stored":true }
}' http://localhost:8983/solr/gettingstarted/schema
type
参数对应于您希望新字段具有的字段类型。
如果您是 using the old schema.xml format,您可以在 XML 中添加字段类型:
<field name="sell_by" type="pdate" indexed="true" stored="true"/>
您必须在更改后重新加载集合的配置。如果您正在使用 Zookeeper(即您手动将配置上传到 Zookeeper),您可以use zkCli.sh
and downconfig
and upconfig
下载和上传配置集。
添加字段后,您必须重新索引应包含该字段的文档,方法是再次将它们提交给 Solr,以便按预期将内容添加到字段中。