lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Complete list of field "type" that Solr supports
Date Wed, 22 Apr 2015 17:46:16 GMT

: I'm confused.  If type="float" is just a symbolic name, how does Solr knows
: to index the data of field "weight" as "float"?  What about for "date" per
: this example:
: 
:     <field name="last_modified" type="date" indexed="true" stored="true"/>
: 
: How does Solr applies date-range queries such as:

because somewhere else in your schema is a <type/> declaration that 
defines "<type name="date" ..." using "class="solr.TrieDateField"

you asked for the complete list of all possible values for the "type" 
attribute on a <field/> -- the answer is "infinite" because the possible 
values for the "type" attribute on a <field/> is dictated by whatever you 
might choose to specify as the "name" attribute on a <type/>

: I was always under the impression that there are primitive field-types but
: looks like that's not the case?

There are FieldType *classes* which can be configured a variety of ways in 
your schema.xml, and then reused by different fields -- but the *names* of 
those "types" is up to you.

for example: the exact same TriDateField *class* can be configured in your 
schema.xml to implement 2 differnet *types* named "date_foo" and 
"date_bar" by using different default options (maybe one uses a 
non-default precisionStep and defaults to stored="true" while the other 
uses the default precisionStep and defaults to stored="faluse") ... those 
two diff types can then both be used in your schema...

  <field name="last_modified" type="date_foo" indexed="true" />
  <field name="pub_date" type="date_bar" indexed="true" />

...and have different behavior.

: 
: Thanks
: 
: Steve
: 
: On Wed, Apr 22, 2015 at 12:59 PM, Chris Hostetter <hossman_lucene@fucit.org>
: wrote:
: 
: >
: > : To be clear, here is an example of a type from Solr's schema.xml:
: > :
: > :     <field name="weight" type="float" indexed="true" stored="true"/>
: > :
: > : Here, the "type" is "float".  I'm looking for the complete list of
: > : out-of-the-box types supported.
: >
: > what you are asking about are just symbolic names that come from <type/>
: > definitions in the schema.xml -- there is no complete list.  you can add
: > any arbitrary <type name="foo" .../> you want to your schema, and now
: > you've introduced a new "type" that solr supports.
: >
: > As far as the list of all "FieldType" *classes* that exist in solr out of
: > the box (ie: the list of classes that can be specified in <type/>
: > declarations, that is a bit more straight forward...
: >
: >
: > https://cwiki.apache.org/confluence/display/solr/Field+Types+Included+with+Solr
: >
: >
: >
: > -Hoss
: > http://www.lucidworks.com/
: >
: 

-Hoss
http://www.lucidworks.com/

Mime
View raw message