| | 185 | <title>Set up a new Document Type for search purpose</title> |
|---|
| | 186 | |
|---|
| | 187 | <para>The query based search service of Nuxeo 5 requires that you create |
|---|
| | 188 | a document type that will be a base for a document model to register |
|---|
| | 189 | data handeld by the query. To understand it more here is an example |
|---|
| | 190 | :</para> |
|---|
| | 191 | |
|---|
| | 192 | <para>You are browsing your documents by coverage. You are selecting the |
|---|
| | 193 | path Europe/France in the tree. The data Europe/France is the base of |
|---|
| | 194 | the query and need to be registered in a document model created from a |
|---|
| | 195 | document type. In this case the document type can be very simple, cause |
|---|
| | 196 | the query must register only one data at a time. Creating a document |
|---|
| | 197 | type with only one schema that contains one field will be enough.</para> |
|---|
| | 198 | |
|---|
| | 199 | <para>This document type will be referenced as <emphasis |
|---|
| | 200 | role="bold">query document type</emphasis> in this walkthrough. Create |
|---|
| | 201 | it and register it as a normal document type. See Nuxeo Book part 6 to |
|---|
| | 202 | get more informations about document type creation.</para> |
|---|
| | 203 | </section> |
|---|
| | 204 | |
|---|
| | 205 | <section> |
|---|
| 194 | | <para>The new tree contribution needs many information, the <emphasis |
|---|
| 195 | | role="bold">schema</emphasis> and the <emphasis role="bold">element of |
|---|
| 196 | | the schema (field)</emphasis> that you will use to navigate through |
|---|
| 197 | | documents,<emphasis role="bold"> a queryModel</emphasis> to indicate the |
|---|
| 198 | | query you will use to get your documents, an <emphasis |
|---|
| | 215 | <para>The new tree contribution needs many informations,<emphasis |
|---|
| | 216 | role="bold"> a queryModel</emphasis> to indicate the query you will use |
|---|
| | 217 | to get your documents, a <emphasis role="bold">schema</emphasis> and a |
|---|
| | 218 | <emphasis role="bold">field</emphasis> coming from the query document |
|---|
| | 219 | type you just set up in part 3, an <emphasis |
|---|
| 238 | | and the field again. The <emphasis role="bold">docType</emphasis> |
|---|
| 239 | | parameter in the <emphasis |
|---|
| 240 | | role="bold"><queryModel></queryModel></emphasis> tag must |
|---|
| 241 | | contain a registered document type that contain the schema you are using |
|---|
| 242 | | now for the queryModel. For more details on document type please see the |
|---|
| 243 | | Nuxeo-Book chapter 6.</para> |
|---|
| | 269 | and the name of the field coming from the <emphasis role="bold">query |
|---|
| | 270 | document type</emphasis> you set up in part 3.</para> |
|---|
| 271 | | search service. You will index the field you are using since the |
|---|
| 272 | | begining of this configuration. Here is the extension point you have to |
|---|
| 273 | | contribute. For a full example see the <emphasis |
|---|
| 274 | | role="bold">nxsearch-contrib.xml</emphasis> file in the <emphasis |
|---|
| 275 | | role="bold">search-core</emphasis> package.</para> |
|---|
| | 298 | search service. You will index the field that register the data you want |
|---|
| | 299 | to apply the search on, it is the same data as saw at the end of part 5 |
|---|
| | 300 | . Here is the extension point you have to contribute. For a full example |
|---|
| | 301 | see the <emphasis role="bold">nxsearch-contrib.xml</emphasis> file in |
|---|
| | 302 | the <emphasis role="bold">search-core</emphasis> package.</para> |
|---|
| 283 | | <emphasis role="bold">type</emphasis> param must be "Path", if the field |
|---|
| 284 | | that register your vocabulary is a complexType (many String for example) |
|---|
| 285 | | you can add the parameter <emphasis role="bold">multiple</emphasis> and |
|---|
| 286 | | set it at "true".</para> |
|---|
| | 310 | <emphasis role="bold">type</emphasis> param must be "<emphasis |
|---|
| | 311 | role="bold">Path</emphasis>", if the field that register your vocabulary |
|---|
| | 312 | is a complexType (list of String for example) you can add the parameter |
|---|
| | 313 | <emphasis role="bold">multiple</emphasis> and set it at "true".</para> |
|---|
| 312 | | <para>All theme contributions and widget displaying already exist in |
|---|
| 313 | | <emphasis role="bold">webapp-core</emphasis> and <emphasis |
|---|
| 314 | | role="bold">virtualNavigation</emphasis> package, you can take a look if |
|---|
| 315 | | you want to modify some parts.</para> |
|---|
| | 339 | <para>All theme contributions and tree navigation widget already exist |
|---|
| | 340 | in <emphasis role="bold">webapp-core</emphasis> and <emphasis |
|---|
| | 341 | role="bold">virtualNavigation</emphasis> package, you can take a look |
|---|
| | 342 | for information purpose.</para> |
|---|