Heinzlmaen
Heinzlmaen

Reputation: 967

Make all new fields text_general in Solr

How can I have Solr use text_general for every (new) field?

I am trying to implement a POC. We frequently have new fields and don't want to update them by hand. On the other side a somewhat simple search will suffice (but we indexing would be nice).

Schemaless mode is only for playing around: Having .45 as a movie name will make it a float field, breaking when a normal movie name is used. So that's not an option.

I tried changing the typeMapping in solrconfig.xml to always map to text_general, but it didn't seem to have any effect. Do I need a custom updateProcessor or something like that?

Upvotes: 0

Views: 110

Answers (1)

Persimmonium
Persimmonium

Reputation: 15789

you can do that in schema.xml, by using a dynamic field:

<dynamicField name="*" type="text_general" .../>

this way any new field that matches the name "*" (so, anything in this case) will use this type.

Upvotes: 1

Related Questions