This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Create custom Search Criterion¶
To provide support for a custom Search Criterion, do the following.
Create Criterion class¶
First, create a CameraManufacturerCriterion.php
file that contains the Criterion class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
Create Criterion visitor¶
Then, add a CameraManufacturerVisitor
class, implementing CriterionVisitor
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
Finally, register the visitor as a service.
Search Criteria can be valid for both Content and Location search.
To choose the search type, use either content
or location
in the tag when registering the visitor as a service:
1 2 3 4 5 |
|
1 2 3 4 5 |
|
This example pretends a new exif_camera_manufacturer_id
data is indexed.
For more information about indexing new additional data,
see Solr document field mappers
or Index custom Elasticsearch data.