Adding/Updating URLs before Solr Indexing

Sometimes you might need to modify a document's location. For example, if your website runs on HTTPS but your SSL offloading is performed by a load balancer in front of your server, In a case like this, indexing a website with the HTTP URLs is not possible. You have to change them to HTTP. The wmasolrsearch bundle in XperienCentral defines a UrlProvider service in the nl.gx.product.wmasolrsearch.api package for just this purpose.

Adding URLs

To add your own set of URLs to the Solr index, you can define a new service that implements the UrlProvider interface and implements the method List<String> getUrlList(boolean includeAll). Using the OSGi dependency mechanism in XperienCentral, this new UrlProvider service is automatically picked up by the SearchService and its list of URLs is appended to the default list in XperienCentral.


Changing or Excluding URLs

URLs can be changed and or removed by creating a new UrlFilter service. The method filterURLs must be implemented and return the new filtered URLs. Similar to the UrlProvider, all UrlFilter services are automatically picked up by the SearchService when the OSGi bundle is installed.

Example

Download the urlProviderService.zip example.