[ 
https://issues.apache.org/jira/browse/SOLR-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788228#action_12788228
 ] 

Yonik Seeley commented on SOLR-1131:
------------------------------------

OK... so the real issue is that this introduces a new mechanism to look up 
field types... not necessarily a horrible thing, but we should definitely think 
twice before doing so.

home___0 and home___1 are not dynamic fields as I understand it (in that there 
is no ___0 dynamic field.  The lookup is done by adding new support to the 
IndexSchema to strip off ___foo off of any field and use that as it's type?

But... that scheme seems to limit us to a single subField type (in addition to 
the other downsides of requiring a new lookup mechanism).

I do want to separate these two issues though:
1) field lookup mechanism (currently just exact name in schema followed by a 
dynamic field check)
2) if and when fields or field types should be explicitly defined in the schema 
vs being created by the polyField

Aside: it looks like the code for getFieldOrNull isn't right?  Seems like it 
will return a field with both the wrong type and the wrong name?
{code}
   public SchemaField getFieldOrNull(String fieldName) {
      SchemaField f = fields.get(fieldName);
@@ -1055,25 +1071,28 @@
     for (DynamicField df : dynamicFields) {
       if (df.matches(fieldName)) return df.makeSchemaField(fieldName);
     }
-    
+    int idx = fieldName.indexOf(FieldType.POLY_FIELD_SEPARATOR);
+    if (idx != -1){
+      String fn = fieldName.substring(0, idx);
+      f = getFieldOrNull(fn);
+    }
     return f;
{code}

> Allow a single field type to index multiple fields
> --------------------------------------------------
>
>                 Key: SOLR-1131
>                 URL: https://issues.apache.org/jira/browse/SOLR-1131
>             Project: Solr
>          Issue Type: New Feature
>          Components: Schema and Analysis
>            Reporter: Ryan McKinley
>            Assignee: Grant Ingersoll
>             Fix For: 1.5
>
>         Attachments: SOLR-1131-IndexMultipleFields.patch, SOLR-1131.patch, 
> SOLR-1131.patch, SOLR-1131.patch, SOLR-1131.patch, SOLR-1131.patch
>
>
> In a few special cases, it makes sense for a single "field" (the concept) to 
> be indexed as a set of Fields (lucene Field).  Consider SOLR-773.  The 
> concept "point" may be best indexed in a variety of ways:
>  * geohash (sincle lucene field)
>  * lat field, lon field (two double fields)
>  * cartesian tiers (a series of fields with tokens to say if it exists within 
> that region)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to