是否有任何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