0

while uploading XML file in solr schemaless mode. all field type are text_general only

i'm trying to change field type text_general to Indexed = "true". for all my field in solr schemaless_mode. There're 500+ fields in the schema.xml file its difficult to change manually

<field name="parap018f49616aad47a2a754d1fd87fdb4de" type="text_general"/>
<field name="parap06bad96ebf194d8d965db37a5124357a" type="text_general"/>

I'm trying to change it.(desire output)

<field name="parap018f49616aad47a2a754d1fd87fdb4de" type="text_general"  indexed="true" stored="false" multiValued="true />
<field name="parap06bad96ebf194d8d965db37a5124357a" type="text_general" indexd="true" stored="false" multiValued="true""/>
Diksha
  • 13
  • 3
  • IIRC the fields added by the schemaless mode is indexed by default? Are you seeing different behavior? If you want to define a field that matches multiple field names you can [add a `dynamicField`, which allows a wildcard in its name](https://solr.apache.org/guide/solr/latest/indexing-guide/dynamic-fields.html) - any field name matching the pattern will be of that type. In this case you could use `parap*` as the name of the dynamic field, and any fields that start with that prefix will have that type. – MatsLindh Nov 05 '22 at 22:34
  • In a dynamicField, I can't get desired out. while searching query for the term – Diksha Nov 08 '22 at 06:02
  • A dynamic field does not behave different from any other fields, so what is your _actual issue_? What do you mean by "can't get desired out"? In your example you've explicitly set the field as not stored, so there won't be any content to return for the field. – MatsLindh Nov 08 '22 at 08:53
  • "can't get desired output?" actually I'm trying to create all schema field(second code as I mentioned in the question) properties with [index="true"] values for search terms in content.(i m using solr 9 Schemaless mode features for automatically generated schema field for Document upload) – Diksha Nov 08 '22 at 09:21

1 Answers1

0

copy your 500+ fields to the text editor and find and replace all at once after type="text_general" and replace in your schema and upload it.

it is more of a copy paste question rather than solr question.

Dimanshu Parihar
  • 347
  • 2
  • 12
  • what if upload document 500+, its difficult to replace type("text_general") in schema.xml file. Thanks. is there any update to add properties in schemaless mode? I'm trying to use a schemaless mode in solr there is only 1 field property ["text_general"]. – Diksha Nov 08 '22 at 05:37