Adding advanced search to the document library
Document Library Pro comes with an instant AJAX search box which appears above the list of documents, as well as a standalone search box. You can add more advanced logic to either or both searches by using it with the SearchWP plugin.
Document Library Pro integrates with SearchWP with no special configuration. SearchWP adds extra search features that Document Library Pro does not include itself, including:
- Relevance weighting, so a title match can count more than a body match.
- Synonyms and stemming, so "invoices" can also match "invoicing".
- Search analytics, so you can see what visitors are searching for.
- Control over which fields are searchable and which fields are ignored.
Note: Since we built this integration, SearchWP have released a free version which is very different from their premium plugin. Document Library Pro only integrates with the premium version.
Limitations
Add the present time, the integration is supported using the default SearchWP plugin, i.e. without any customisations. Customisations to SearchWP are not supported in Document Library Pro.
The current known limitations are:
- Strict search (or exact phrase match search) is not supported. This is enabled in SearchWP using the filter
searchwp\query\logic\phrase\strict
Search box above the document library
This is how to use SearchWP to power the search box that appears above the list of documents in the document library:
- Install Document Library Pro.
- Install SearchWP and make sure you have added the 'Documents'
dlp_documentpost type as a Source on the default SearchWP engine.
Standalone search
You can also use SearchWP to power the standalone search that is built into Document Library Pro.
This is how to do it:
- Install Document Library Pro.
- Install SearchWP and make sure you have added the 'Documents'
dlp_documentpost type as a Source on the default SearchWP engine. - Finally, add the 'Document Library Pro: Search Box' widget or
[doc_search]shortcode anywhere on your site, e.g. the homepage or a sidebar.
Once you have done this, customers can use the search box (which will be powered by SearchWP) wherever it appears on your site. The results will appear within a document library.