是否有任何solr api来读取solr schema.xml?我需要它的原因是solr facet不是向后兼容的。如果索引未定义字段A,但程序试图为字段A生成构面,则所有构面都将失败。因此,我需要在运行时检查索引中的哪些索引字段,并动态生成构面。solr是否有API来读取solr schema.xml?
5
A
回答
3
你可以得到http://localhost:8983/solr/admin/file/?contentType=text/xml;charset=utf-8&file=schema.xml
这是原始的XML架构,因此必须对其进行解析,以获得您所需要的信息。但是,如果你的程序产生一个无效的方面,也许你应该修复程序,而不是试图解决这个问题。
3
3
由于Solr的4.2架构REST API允许你用得到的架构:
http://localhost:8983/solr/schema
或核心名称:
http://localhost:8983/solr/mycorename/schema
由于Solr的4.4你也可以修改你的模式。
1
其实你拥有该架构的API。 Solr模式API允许使用REST API来获取有关信息的schema.xml
在Solr的4.2和4.3,它只允许GET(只读)访问,但在 Solr的4.4,新领域和新copyField指令可能会添加到架构中。未来的Solr的版本将扩展这一功能,让更多的模式 元素进行更新
API入口点
/collection/schema: retrieve the entire schema
/collection/schema/fields: retrieve information about all defined fields, or create new fields with optional copyField directives
/collection/schema/fields/name: retrieve information about a named field, or create a new named field with optional copyField directives
/collection/schema/dynamicfields: retrieve information about dynamic field rules
/collection/schema/dynamicfields/name: retrieve information about a named dynamic rule
/collection/schema/fieldtypes: retrieve information about field types
/collection/schema/fieldtypes/name: retrieve information about a named field type
/collection/schema/copyfields: retrieve information about copy fields, or create new copyField directives
/collection/schema/name: retrieve the schema name
/collection/schema/version: retrieve the schema version
/collection/schema/uniquekey: retrieve the defined uniqueKey
/collection/schema/similarity: retrieve the global similarity definition
/collection/schema/solrqueryparser/defaultoperator: retrieve the default operator
例子
输入 获取所有字段的列表。
输入 获取JSON整个模式。
curl http://localhost:8983/solr/collection1/schema?wt=json
更多信息here: apache-solr-ref-guide-4.5.pdf(搜索模式API)
相关问题
- 1. Apache Solr&schema.xml
- 2. solr schema.xml validate
- 3. 更改solr中的schema.xml
- 4. 是SOLR加载正确的schema.xml属性?
- 5. 是否有C++ SOLR库?
- 6. 如何查询Solr?和修改Schema.xml的
- 7. 重新加载Zookeeper solr conf(schema.xml)
- 8. Schema.xml的多模式(Solr的3.6)
- 9. 在基本配置(单核)中是否有与solr 5.3.1兼容的nutch schema.xml?
- 10. 如何从solr索引读取?
- 11. 如果Solr无法访问,Apache-Solr是否有超时?
- 12. 将mongo动态数据添加到没有schema.xml的solr中
- 13. Solr是否适用于.Net?
- 14. 读通过的Solr
- 15. solr是否有post-commit挂钩(或其他)来通知slave?
- 16. 加入我自己的类来SOLR 5.3.1
- 17. 是否可以将备份从Solr 6.0恢复到Solr 6.1?
- 18. 是否有可能将Solr UniqueKey类型“String”更改为Apache Solr中的其他类型
- 19. 如何从solr读取嵌套结构?
- 20. 强制Solr从更新索引读取
- 21. 段是Solr的
- 22. 在Solr中查找具有Solr
- 23. solr云中创建Solr核心(solr 4.1.0)
- 24. 力Solr的不是搜索
- 25. 将solr 4架构应用到solr 6
- 26. 是否有API读取ePub书籍?
- 27. Solr。何时需要重新索引。它只是在您的schema.xml中更改后?
- 28. solr strfield with haystack django
- 29. 使用Solr配置API
- 30. WSO2 API Manager问题与solr
剂量Solr的有API来读它?我注意到读取solrconf.xml的api是可用的。但是我找不到schema.xml文件 –
@Qing Zhang:你的客户端平台是什么? –
如何通过api读取solrconf.xml文件的任何链接?我试图找到,但无法找到它。 – Krunal