lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noble Paul (JIRA)" <>
Subject [jira] Commented: (SOLR-1664) Some Methods in FieldType actually should be in SchemaField
Date Thu, 17 Dec 2009 14:29:18 GMT


Noble Paul commented on SOLR-1664:
---------------------------------- only makes sense to make it non-final if you change a bunch of other stuff.

Yes. So if some FieldType needs to change the behavior (such as createField, getFieldQuery)
on a per-field basis ,there is no straight way to do it. So far there haven't been any. But
SOLR-1131 opens the door for more such usecasee. if we don't do it now , it may come up later.

bq.This is about changing the design of FieldType and SchemaField, and it's too big of a change
for 1.5, right?

It did not make any non-backcompat changes other than making some  public methods protected
. So I am not sure if it qualifies as too big a change. 

> Some Methods in FieldType actually should be in SchemaField
> -----------------------------------------------------------
>                 Key: SOLR-1664
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Noble Paul
>             Fix For: 1.5
>         Attachments: SOLR-1664.patch
> The following methods are only overridable from FieldType. 
> {code:java}
> public Field createField(SchemaField field, String externalVal, float boost) ;
> protected Field.TermVector getFieldTermVec(SchemaField field,String internalVal) ;
> protected Field.Store getFieldStore(SchemaField field,String internalVal);
> protected Field.Index getFieldIndex(SchemaField field,String internalVal);
> public ValueSource getValueSource(SchemaField field, QParser parser);
> public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2,
boolean minInclusive, boolean maxInclusive) ;
> {code}
> if there is anything specific to be done on a per-field basis it is not possible. if
we allow overriding SchemaField it will be more flexible.
> I hope this can make it simpler to implement SOLR-1131
> So ,there are two ways of overriding a functionality.
> * Override Fieldtype#createSchemaField() and provide new implementation of SchemaField
> * Override methods from FieldType itself(if the behavior is not per field ) as it is
> SchemaField is made non-final and Solr only invokes methods on SchemaField and not FieldType

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

View raw message