Docs about custom types

This commit is contained in:
Ingo Schommer 2012-09-03 23:18:36 +02:00
parent 2a3e882d70
commit 6f3d3ca8be
1 changed files with 17 additions and 0 deletions

View File

@ -76,6 +76,23 @@ You can also copy the `thirdparty/`solr directory somewhere else,
just set the path value in `mysite/_config.php` to point to the new location.
And of course run `java -jar start.jar` from the new directory.
### Custom Types
Solr supports custom field type definitions which are written to its XML schema.
Many standard ones are already included in the default schema.
As the XML file is generated dynamically, we can add our own types
by overloading the template responsible for it: `types.ss`.
In the following example, we read out type definitions
from a new file `mysite/solr/templates/types.ss` instead:
<?php
class MyIndex extends SolrIndex {
function getTypes() {
return $this->renderWith(Director::baseFolder() . '/mysite/solr/templates/types.ss');
}
}
## Debugging
### Using the web admin interface