Docs about custom types
This commit is contained in:
parent
2a3e882d70
commit
6f3d3ca8be
17
docs/Solr.md
17
docs/Solr.md
|
@ -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.
|
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.
|
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
|
## Debugging
|
||||||
|
|
||||||
### Using the web admin interface
|
### Using the web admin interface
|
||||||
|
|
Loading…
Reference in New Issue