Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Solr have an API to read schema.xml?

Tags:

schema

solr

facet

Is there any Solr API to read the Solr schema.xml?

The reason I need it is that Solr faceting is not backwards compatible. If the index doesn't define field A, but the program tries to generate facets for field A, all the facets will fail. Therefore I need to check in the runtime what fields we have in the index, and generate the facets dynamically.

like image 476
Qing Zhang Avatar asked Aug 30 '11 17:08

Qing Zhang


People also ask

Where is schema xml in Solr?

The Solr schema. xml (typically found in the solr/conf/ directory) is where you tell Solr what types of fields you plan to support, how those types will be analyzed, and what fields you are going to make available for import and queries. Solr will then base its Lucene underbelly on what you define.

Is Solr an API?

Using SolrJ: Detailed information about SolrJ, an API for working with Java applications. Using JavaScript: Explains why a client API is not needed for JavaScript responses.

What is schema xml in Solr?

The Solr search engine uses a schema. xml file to describe the structure of each data index. This XML files determines how Solr will build indexes from input documents, and how to perform index and query time processing. As well as describing the structure of the index, schema.

What is Solr REST API?

Solr is written in Java and runs as a standalone full-text search server. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like JSON APIs that make it easy to use from virtually any programming language.


1 Answers

Since Solr 4.2 the Schema REST API allows you to get the schema with :

http://localhost:8983/solr/schema

or with a core name :

http://localhost:8983/solr/mycorename/schema

Since Solr 4.4 you may also modify your schema.

more details on the Solr Wiki page

like image 103
Edna Avatar answered Oct 07 '22 11:10

Edna