![]() |
Antidot PHP API
version 0.16.0
##PHP API to simplify integration of Antidot components
|
This API greatly simplifies querying of Antidot search engine. Only one class needs to be instanciated.
Instance of AfsSearch is initialized with host name hosting AFS search service and the service identifier (id and status which is set to stable
by default).
Specific search URL is provided by production team and should be similar to http://your_company.afs-antidot.net/search
Along with the search URL, a service number and service status should also have been provided. These informations are used to initialized the instance of AfsSearch. Production services are not modified in place so their status are usually stable
.
Here an example to initialize an AFS search object:
Once the object is initialized, query can be submitted by calling AfsSearch::execute method.
Here a summarize of the query usages:
If the query should be initialized with URL parameters, this can be done as following:
Otherwise, you can define initial query and set it with AfsSearch::set_query.
Once the query is initialized, AFS search engine can be queried as following:
Default result is formatted as array
. Alternate result format is available see AfsSearch::execute for more details.
Facets can be declared and configured by instantiating AfsFacet. But, if no specific configuration is necessary, facets are deduced from the reply of AFS search engine.
Example of declaration: