The example schema and solrconfig are intended to
show you a large number of possibilities, they are
not necessarily intended to be "best practices". I would
argue that if you do _not_ want to have dynamic fields
defined, you should take them all out. And you should
take all of the other field definitions out that you don't want
in your specific installation. Ditto with the solrconfig stuff.
Do you use QueryElevationComponent? Clustering?
Autosuggest? No? Then rip them out. Ditto with
unused field types. Ditto with....

I admit this is a personal preference, but the next person
to try to maintain your system will thank you for not
having to wonder if s/he needs all that stuff.

HOWEVER!!!!
Do not remove _version_, _root_ or "id" fields from your
schema.xml file unless you're absolutely certain you know
the consequences. And given your first question, at this
stage I suspect you don't know those consequences ;). The
same for any schema.xml field that starts and ends with
an underscore (_)...

And watch out for the "text" field. If you remove it blindly,
your schema, the core won't initialize since the solrconfig.xml file
look for the "text" field in several handlers to define the
default search field if no field is explicitly placed in the search.

This is not hard to fix, just be prepared to spend some time
chasing stuff like that down if you aggressively clean up
stuff you don't think you need.

Best,
Erick

On Mon, Sep 22, 2014 at 11:24 AM, mark12345
<marks1900-pos...@yahoo.com.au> wrote:
> Thanks for that link.  From what I read the performance difference is
> negligible, especially if I would just be replacing one static field with a
> dynamic one.
>
>
> Erick Erickson wrote
>> Sep 14, 2014; 12:06pm Re: Solr Dynamic Field Performance
>>
>>
>> Dynamic fields, once they are actually _in_ a document, aren't any
>> different than statically defined fields. Literally, there's no place
>> in the search code that I know of that _ever_ has to check
>> whether a field was dynamically or statically defined.
>>
>> AFAIK, the only additional cost would be figuring out which pattern
>> matched at index time, which is such a tiny portion of the cost of
>> indexing that I doubt you could measure it.
>>
>> Best,
>> Erick
>
> This leads me to my next question.  Does anyone know why doesn't Solr come
> out of the box with dynamic fields for every field type (Simple example
> below)?  Also is there a better template (Best practice) than
> "solr-4.10.0/example/solr/collection1/conf/schema.xml"?
>
>
>>
>> <dynamicField name="*_i"  type="int"     indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_is" type="int"     indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_s"  type="string"  indexed="true"  stored="true" />
>>
>> <dynamicField name="*_ss" type="string"  indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_l"  type="long"    indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_ls" type="long"    indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_b"  type="boolean" indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_bs" type="boolean" indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_f"  type="float"   indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_fs" type="float"   indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_d"  type="double"  indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_ds" type="double"  indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_t"  type="text_general"  indexed="true"
>> stored="true"/>
>>
>> <dynamicField name="*_ts" type="text_general"  indexed="true"
>> stored="true" multiValued="true"/>
>>
>> <dynamicField name="*_en" type="text_en"       indexed="true"
>> stored="true" multiValued="true"/>
>>
>>
>> <dynamicField name="*_i_raw"   type="int"     indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_is_raw"  type="int"     indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_s_raw"   type="string"  indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_ss_raw"  type="string"  indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_l_raw"   type="long"    indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_ls_raw"  type="long"    indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_b_raw"   type="boolean" indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_bs_raw"  type="boolean" indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_f_raw"   type="float"   indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_fs_raw"  type="float"   indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_d_raw"   type="double"  indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_ds_raw"  type="double"  indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_t_raw"   type="text_general"  indexed="false"
>> stored="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_ts_raw"  type="text_general"  indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>> <dynamicField name="*_en_raw"  type="text_en"       indexed="false"
>> stored="true"  multiValued="true"  omitNorms="true"/>
>>
>
>>
>> <dynamicField name="*_coordinate"  type="tdouble" indexed="true"
>> stored="false" />
>>
>> <dynamicField name="*_dt"  type="date"    indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_dts" type="date"    indexed="true"  stored="true"
>> multiValued="true"/>
>>
>> <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
>>
>> <dynamicField name="*_coordinate_raw"  type="tdouble"  indexed="false"
>> stored="false" omitNorms="true"/>
>>
>> <dynamicField name="*_dt_raw"   type="date"      indexed="false"
>> stored="true" omitNorms="true"/>
>>
>> <dynamicField name="*_dts_raw"  type="date"      indexed="false"
>> stored="true" multiValued="true" omitNorms="true"/>
>>
>> <dynamicField name="*_p_raw"    type="location"  indexed="false"
>> stored="true" omitNorms="true"/>
>>
>
>>
>> <dynamicField name="*_s_lowercase"     type="string_lowercase"
>> indexed="true"  stored="true" />
>>
>> <dynamicField name="*_ss_lowercase"    type="string_lowercase"
>> indexed="true"  stored="true" multiValued="true"/>
>>
>> <dynamicField name="*_s_autocomplete"  type="string_autocomplete"
>> indexed="true"  stored="true" />
>>
>> <dynamicField name="*_ss_autocomplete" type="string_autocomplete"
>> indexed="true"  stored="true" multiValued="true"/>
>>
>> <dynamicField name="*_t_lowercase"     type="text_lowercase"
>> indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_ts_lowercase"    type="text_lowercase"
>> indexed="true"  stored="true" multiValued="true"/>
>>
>> <dynamicField name="*_t_autocomplete"  type="text_autocomplete"
>> indexed="true"  stored="true"/>
>>
>> <dynamicField name="*_ts_autocomplete" type="text_autocomplete"
>> indexed="true"  stored="true" multiValued="true"/>
>>
>
>>
>> <dynamicField name="*_binary_raw"    type="binary"  indexed="false"
>> stored="true"/>
>>
>> <dynamicField name="*_binaries_raw"  type="binary"  indexed="false"
>> stored="true" multiValued="true"/>
>>
>
>
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Static-Fields-Performance-vs-Dynamic-Fields-Performance-tp4160316p4160513.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to