The API Manager has Apache Solr based indexing for API documentation content. It provides both the API Publisher and Store full-text search facility to search through API documentation, find documents and related APIs. The search syntax is doc:keyword. Search criteria looks for the keyword in any word/phrase in the documentation content and returns both the matching documents and associated APIs.
The following media types have Apache Solr based indexers by default, configured using the
<Indexers> element in
- Text : text/plain
- PDF : application/pdf
- MS word : application/msword
- MS Powerpoint : application/vnd.ms-powerpoint
- MS Excel : application/vnd.ms-excel
- XML : application/xml
Writing a custom index
In addition to the default ones, you can write your own indexer implementation and register it as follows:
Write a custom indexer. Given below is a sample indexer code.
Add the custom indexer JAR file to
<APIM_HOME>/repository/conf/registry.xmlfile with the new indexer. The content is indexed using this media type. For example,
The attributes of the above configuration are described below:
class Java class name of the indexer mefiaTypeRegEx A regex pattern to match the media type profiles APIM profiles in which the indexer is available
- Restart the server.
- Add API documentation using the new media type and then search some term in the documentation using the syntax (doc:keyword). You will see how the documentation has got indexed according to the media type.