Eric Pugh created SOLR-18694:
--------------------------------

             Summary: Schema Designer: don't turn sample fields that match a 
dynamic field into explicit fields, and support deleting fields
                 Key: SOLR-18694
                 URL: https://issues.apache.org/jira/browse/SOLR-18694
             Project: Solr
          Issue Type: Improvement
          Components: Schema Designer
    Affects Versions: 9.11
            Reporter: Eric Pugh


When the Schema Designer analyzes sample documents, every field it finds is 
added to the schema as an explicit field, including fields that an existing 
dynamic field already covers. For example, analyzing 
example/exampledocs/books.json against the techproducts configset adds explicit 
genre_s, pages_i, sequence_i and series_t fields, although *_s, *_i and *_t 
already handle them. Publishing then writes these redundant definitions into 
the configset, and each new batch of sample data adds more.

This is intentional in the current design. DefaultSchemaSuggester.suggestField 
returns the matching dynamic field's SchemaField and 
SchemaDesigner.analyzeInputDocs adds it. The reason is that the UI is built 
entirely on explicit fields: the response's fields list (schema.getFields()) 
drives the Fields tree, field editing, the Query Tester's sort/facet/highlight 
lists, and Text Analysis. Without promotion, those fields would vanish from the 
UI.

There is also no way to undo it in the designer. The Delete button in 
partials/schema-designer.html has been commented out since SOLR-15277, and 
deleteSelected() in schema-designer.js is an empty stub. The managed schema 
file is also left out of the Files list.

Proposal
1. Stop promoting fields that match a dynamic field. Return them in a separate 
response list, e.g. dynamicFieldMatches, each with the dynamic field pattern it 
matched. Show them in the UI (for example as "genre_s (dynamic: *_s)") and 
include them in the Query Tester menus and Text Analysis.
2. Editing one of these fields turns it into an explicit field at that point, 
through the existing update path.
3. Implement field (and dynamic field / field type) deletion: a backend 
endpoint plus the UI button.

Workaround until then: remove the redundant fields after publishing with the 
Schema API delete-field command. The ref guide notes this (PR #5412).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to