Why did they create the concept of "schema.xml" in Solr?

Lucene searches and indexes using "coding" ... Why doesn't Solr do the same? Why do we need schema.xml? What is its importance? Is there a way to avoid placing all the fields we want in schema.xml? (I think dynamic fields are the way, right?)

+3
source share
3 answers

This is how it was built. Lucene is a library, so you link your code to it. Solr, on the other hand, is a server, and in some cases you can just use it with very little coding (for example, using DataImportHandler for indexing and the Velocity plugin for searching and searching).

, .

, Lucene, ElasticSearch.

+6

schema.xml, . , Sunspot schema.xml - .

https://github.com/outoftime/sunspot/blob/master/sunspot/solr/solr/conf/schema.xml

content_text :

<dynamicField name="*_text" stored="false" type="text" multiValued="true" indexed="true"/>

fieldType.

schema.xml, , Sunspot. , , schema.xml.

+5

Solr acts as a standalone search server and can be configured without coding. You can think of it as the face for Lucene. The purpose of the schema.xml file is to determine your index.

If possible, I would suggest defining all of your fields in the schema file. This gives you more control over how these fields are indexed, and allows you to use copy fields (if you need them).

+1
source

Source: https://habr.com/ru/post/1795089/


All Articles