[ https://issues.apache.org/jira/browse/SOLR-6018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aaron LaBella updated SOLR-6018: -------------------------------- Description: There is an issue with *org.apache.solr.handler.dataimport.DocBuilder:addFields* around ~line 643. The logic currently says see if you can find the field from the schema, ie: {code:title=DocBuilder.java|borderStyle=solid} SchemaField sf = schema.getFieldOrNull(key); {code} and, if not found, go ask DIHConfiguration to find it, ie: {code:title=DocBuilder.java|borderStyle=solid} sf = config.getSchemaField(key); {code} The latter call takes into account case-insensitivity, which is a big deal since some databases, ie: DB2, upper case all the resulting column names. In order to not modify solr-core (ie: the match login in IndexSchema), I'm attaching a patch that makes DIHConfiguration apply the same case-insensitive logic to the DynamicFields. Without this patch, dynamic fields will not be added to the index unless you declare them like this: {code:xml} <dynamicField name="*_S" type="string" indexed="true" stored="true" /> {code} (note the capital S) which is in-consistent with what I believe to be solr schema conventions to have all the schema fields as lower-case. Thanks. was: There is an issue with *org.apache.solr.handler.dataimport.DocBuilder:addFields* around ~line 643. The logic currently says see if you can find the field from the schema, ie: {code:title=DocBuilder.java|borderStyle=solid} SchemaField sf = schema.getFieldOrNull(key); {code} and, if not found, go ask DIHConfiguration to find it, ie: {code:title=DocBuilder.java|borderStyle=solid} sf = config.getSchemaField(key); {code} The latter call takes into account case-insensitivity, which is a big deal since some databases, ie: DB2, upper case all the resulting column names. In order to not modify solr-core (ie: the match login in IndexSchema), I'm attaching a patch that makes DIHConfiguration apply the same case-insensitive logic to the DynamicFields. Without this patch, dynamic fields will not be added to the index unless you declare them like this: {code:xml} <dynamicField name="*_S" type="string" indexed="true" stored="true" /> {code} (note the capital S) which is in-consistent with what I believe to be solr schema conventions to have all the schema fields as lower-case. Thanks. > Solr DataImportHandler not finding dynamic fields > ------------------------------------------------- > > Key: SOLR-6018 > URL: https://issues.apache.org/jira/browse/SOLR-6018 > Project: Solr > Issue Type: Bug > Components: contrib - DataImportHandler > Affects Versions: 4.7 > Reporter: Aaron LaBella > Fix For: 4.9 > > Attachments: 0001-dih-config-check-for-dynamic-fields.patch > > > There is an issue with > *org.apache.solr.handler.dataimport.DocBuilder:addFields* around ~line 643. > The logic currently says see if you can find the field from the schema, ie: > {code:title=DocBuilder.java|borderStyle=solid} > SchemaField sf = schema.getFieldOrNull(key); > {code} > and, if not found, go ask DIHConfiguration to find it, ie: > {code:title=DocBuilder.java|borderStyle=solid} > sf = config.getSchemaField(key); > {code} > The latter call takes into account case-insensitivity, which is a big deal > since some databases, ie: DB2, upper case all the resulting column names. In > order to not modify solr-core (ie: the match login in IndexSchema), I'm > attaching a patch that makes DIHConfiguration apply the same case-insensitive > logic to the DynamicFields. > Without this patch, dynamic fields will not be added to the index unless you > declare them like this: > {code:xml} > <dynamicField name="*_S" type="string" indexed="true" stored="true" /> > {code} > (note the capital S) > which is in-consistent with what I believe to be solr schema conventions to > have all the schema fields as lower-case. > Thanks. -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org