Field:
field is just a field, and it's simple to define one:
XML code
- <span style="font-size:20px;" ><field name="tile" type="string" indexed="true" stored=" True "/></span>
Field properties are similar to FieldType, whose properties override FieldType's same name attribute.
Copyfield
You may want to make some fields of document available multiple times. SOLR has a field replication mechanism that can submit several different types of fields to a field, such as copying the title field and the Content field into a new field, so that the new field has the contents of both fields. Field copying mainly involves two concepts, source and destination, one for the field to copy, and the other to which field to copy, here is an example:
<
copyField
source
=
"cat"
dest
=
"text"
maxChars
=
"30000"
/>
In the above example, if the Cat field has data, the contents of the Cat field will be added to the text field. The Maxchars parameter, an int type parameter, that restricts the number of characters copied. Both source and destination support wildcard characters. The following is a copy of all fields ending in _t to the text field.
<
copyField
source
=
"*_t"
dest
=
"text"
maxChars
=
"25000"
/>
In fact, for example, if you want to query the blog containing "Java", then you are sure to check the content, whether the title contains Java, but SOLR cannot be like SQL, where tittle likes '%java% ' or content as '%java% '. This time Copyfield come in handy, define a new field, copy the title and content to the new field, index, and query directly from this new field, so you can reach the goal. This is the typical application scenario for Copyfield.
Note: If Dest is composed of more than one source, it needs to be specified as multivalued.
XML code
- <schema name= "eshequn.post.db_post.0" version="1.1 "
- xmlns:xi="Http://www.w3.org/2001/XInclude">
- <fields>
- <!--for title --
- <field name="T" type="text" indexed="true" stored="false" />
- <!--for abstract --
- <field name="a" type="text" indexed="true" stored="false" />
- <!--for title and abstract --
- <field name="ta" type="text" indexed="true" stored="false" multivalued="true"/>
- </fields>
- <Copyfield source="T" dest="ta" />
- <Copyfield source="a" dest="ta" />
- </schema>
DynamicField: Dynamic fields allows SOLR to index fields that are not explicitly defined in the schema. This feature is useful when you forget to define some fields. Dynamic fields can make the system more flexible and more versatile. A dynamic field is similar to a regular field, except that it contains a wildcard character that, when indexed, matches a field in a dynamic field if there is no match in the regular field. Suppose the schema defines a dynamic dynamic field called *_i, if you want to index a field called cost_i, but there is no cost_i field in the schema, so cost_i is indexed into the *_i field. Dynamic fields are also defined in the Schema.xml file, as are other fields, which also have nouns, field types, and properties.
"Source Address acquisition
SPRINGMVC + mybatis Integration details, and the problems encountered, please refer to the following information:
Resources:
Http://www.springmvc,net/detail/6074493.html
http://my.spring.net/wangbiglei/blog/489583
http://my.springmvc.net/wangbiglei/blog/489604
field, Copyfield, DynamicField in SOLR