5.6 Full text search
The full-text search screen can be customised:
In the <wikidata> directory, look for a file named conf/search-fulltext.xml
<?xml version="1.0"?>
<searchconf>
<!--
<documentName show="true" autoWildcards="false"/>
-->
<fullText show="true" required="true"/>
<collections show="true" useSiteCollection="true">
<!-- eg: <collection>testsite</collection> -->
</collections>
<!-- note: @showExclude and @exclude only have effect if @show="true"
<documentTypes show="false" showExclude="true" exclude="true">
<documentType>SimpleDocument</documentType>
</documentTypes>
-->
<!--
<partTypes show="true">
<partType>NavigationPart</partType>
</partTypes>
-->
</searchconf>
- documentName: Allow users to search the document name field. This will not use the FullText function from the query language but search in the document name field in the database.
- show: (boolean) show this field
- autoWildcards: (boolean) if true, a percent sign will automatically added before and after the search phrase. If false document name must match exactly (unless the user manually adds % signs)
- fullText: enable full-text searching
- show: (boolean) show the full-text search fields
- required: (boolean) if true, the fullText query field is required
- collections
- show: (boolean) show the collections selection field
- useSiteCollection: (boolean) Add the current site to the default selection
- use nested <collection> elements to add specific collections to the default selection. These collections must exist.
- documentTypes
- show: (boolean) show the document type selection field
- showExclude: (boolean) show a checkbox enabling the user to invert the document selection
- exclude: (boolean) default value for the exclude checkbox
- use nested <documentType> elements to add specific documentTypes to the default selection. These documentTypes must exist
- partTypes
- show: (boolean) show the part type selection field. This will enable searching for documents that have certain parts.
- use nested <partType> elements to add specific partTypes to the default selection. These part types must exist.
After editing the configuration, it can take up to 10 seconds for the changes to take effect.
Configuration choices
The configuration of the search screen is up to the site administrators. Searches can put a serious load on the server. If your server is not up for it, you should not enable all the search fields. The defaults have been chosen to be reasonable for most servers.
These factors can influence your choice:
- Number of concurrent users (more users means more searches)
- Technical understanding of the users. If your users do not know what a part type is, there is little point in enabling the field
- Number of documents (more documents means higher load)
There are two ways to search in the document name:
- based on an sql clause (using the 'documentName' configuration option)
- based on the fulltext search index
Currently there is little point for enabling documentName, this has mainly been implemented to allow other search screens to use a similar configuration file in the future
Site-specific search configuration
If you want a specific site to have other configuration options, put a copy of search-fulltext.xml under <location of wikidata dir>/sites/<site>/conf (create this directory if it does not exist yet).
Previous