lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: SOLR-1131 - Multiple Fields per Field Type
Date Thu, 10 Dec 2009 11:16:11 GMT

On Dec 10, 2009, at 1:01 AM, Mattmann, Chris A (388J) wrote:

> Hi Yonik et al.,
> 
> I¹d like to add:
> 
> Option C: Sub fields are specified as a attribute on the fieldType tag
> ============================================================================
> // needed to essentially define the point type
> <fieldType name="latlon" class="GeoPoint" subFieldSuffix="_latlon" ../>
> 
> // uses of the latlon type
> <field name="home" type="latlon" indexed="true" stored="false"/>
> 
> // subFieldSuffix is appended to the subFields indexed and thus those would
> be:
> 
> home_latlon_0
> home_latlon_1
> 
> I like elements of Option B that you present below, however it seems to be
> mixing concerns. Type inheritance (aka your "subFieldType" attribute) seems
> to be orthogonal to poly fields -- a good idea, but another issue IMHO.
> 


I'm not sure this works, as you need to specify the type of the subfield, which is what Option
B does.   I don't think inheritance is the what is going on here, more like delegation, and
that isn't necessarily needed for all implementations, but just happens to be how it is done
for the example in question.  People implementing FieldTypes could certainly just encode things
the way they want using their own internal mechanism (or the existing ones, but w/o configuration).


> Cheers,
> Chris
> 
> On 12/9/09 1:12 PM, "Yonik Seeley" <yonik@lucidimagination.com> wrote:
> 
>> Proposal for handling points using only the field lookup mechanisms
>> currently in place in IndexSchema:
>> 
>> Option A: dynamic fields used for subfields, those dynamic fields need
>> to be explicitly defined in the XML
>> ============================================================================
>> // needed to essentially define the point type
>> <fieldType name="latlon" class="TrieDoubleFIeld" precisionStep="8"/>
>> <fieldType name="point" subFieldSuffix="_latlon" .../>
>> <dynamicField name="*_latlon" type="latlon" indexed="true" stored="false"/>
>> 
>> // uses of the point type
>> <field name="home" type="point"/>
>> <dynamicField name="*_point" type="point"/>
>> 
>> // subFieldSuffix is appended to the subFields indexed and thus those would be
>> home__0_latlon
>> home__1_latlon
>> 
>> // And the indexed fields for dynamic field work_point would be
>> work_point__0_latlon
>> work_point__1_latlon
>> 
>> // NOTE: this scheme works fine for subFields with different fieldTypes
>> 
>> Option B: dynamic fields used for subfields, dynamic fields inserted
>> into schema automatically
>> ====================================================================
>> // needed to essentially define the point type
>> <fieldType name="latlon" class="TrieDoubleFIeld" precisionStep="8"/>
>> <fieldType name="point" subFieldType="latlon"/>
>> 
>> // uses of the point type
>> <field name="home" type="point"/>
>> <dynamicField name="*_point" type="point"/>
>> 
>> // A dynamic field is inserted into the schema by the point class of
>> the form __<subFieldTypeName> by default.
>> // This could be changed via an optional subFieldSuffix param on the
>> point fieldType.  double underscore used
>> // to minimize collisions with user-defined dynamic fields.
>> home_0__latlon
>> home_1__latlon
>> 
>> // And the indexed fields for dynamic field work_point would be
>> work_point__0__latlon
>> work_point__1__latlon
>> 
>> // NOTE: this scheme works fine for subFields with different fieldTypes
>> 
>> 
>> -Yonik
>> http://www.lucidimagination.com
>> 
> 
> 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Chris Mattmann, Ph.D.
> Senior Computer Scientist
> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 171-266B, Mailstop: 171-246
> Email: Chris.Mattmann@jpl.nasa.gov
> WWW:   http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Adjunct Assistant Professor, Computer Science Department University of
> Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> 

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using Solr/Lucene:
http://www.lucidimagination.com/search


Mime
View raw message