Solr02 fields

376 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
376
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Solr02 fields

  1. 1. Solr - Fields Eng. Ismail Enjreny Solr Expert ismaeel.enjreny@gmail.com
  2. 2. Field Types • BinaryField • BoolField • ByteField • CurrencyField • ExternalFileField • EnumField • LatLonType • PointType • TrieDateField, TrieDoubleField, TrieFloatField, TrieIntField
  3. 3. Defining Type (schema.xml) <fieldType name="text_general" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StopFilterFactory" words="stopwords.txt" /> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.StopFilterFactory" words="stopwords.txt" /> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" /> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>
  4. 4. Defining Fields (schema.xml) Single Value <field name="name" type="text_general" indexed="true" stored="true"/> Multi Values <field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/> Not stored <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
  5. 5. Copying Fields (schema.xml) • You might want to interpret some document fields in more than one way <copyField source="cat" dest="text"/> <copyField source="name" dest="text"/> <copyField source="features" dest="text"/> <copyField source="*_t" dest="text" maxChars="25000" />
  6. 6. Dynamic Fields (schema.xml) • Dynamic fields allow Solr to index fields that you did not explicitly define in your schema • Dynamic field is just like a regular field except it has a name with a wildcard in it <dynamicField name="*_i" type="int" indexed="true" stored="true"/>
  7. 7. Demo
  8. 8. Questions?
  9. 9. Thanks

×