Before undertaking this customization, you should be familiar with the information presented in the Details of Lucene Indexing in the Geoportal and the Add a Custom Profile topics. Indexing is important because it determines what search results are returned when a user submits search criteria to the geoportal. By default, not all metadata elements are indexed by the geoportal. The Geoportal is set to index information in a metadata document that meets two criteria:
- the information must be located at a parameter defined in its metadata profile's definition.xml file. If the metadata cannot be mapped to a parameter in definition.xml file, it cannot be indexed.
- that associated parameter in the profile's definition.xml file must have a meaning attribute assigned to it as defined in that profile's indexables.xml file.
However, if it is very important to your organization that all information in a metadata document is searchable, then you will want to index all metadata content. Follow the steps below.
- You will need to add an additional parameter to the indexables.xml file for the profile for which you want to index all content. Open the indexables.xml file for that profile in a text editor, and scroll to the bottom of the file.
- Add a line before the closing </indexables> tag that reads:
<property meaning="body" xpath="/rdf:RDF/rdf:Description/*"/>
- This example shows the xpath value pointing to a large portion of the Dublin Core metadata profile. You will need to update the xpath attribute to match an xpath that encompasses all elements in your profile of interest. For example, for ISO-based profiles, this xpath attribute should read xpath="/gmd:MD_Metadata/*"
- Update the xpath attribute's value to support your profile of interest.
- Save the file indexables.xml.
- Repeat for each supported profile in your geoportal for which you want to index all content.
- Stop the geoportal web application.
- Navigate to the folder defined for the lucene index. This is the filepath located at the <lucene> element's indexLocation attribute in the gpt.xml file (from the \\geoportal\WEB-INF\classes\gpt\config folder).
- You need to clear the old index and create a new one. You can do this by either deleting all the old files from the lucene indexing folder, or you can create a new folder and update the filepath in the <lucene> element in gpt.xml.
- Save gpt.xml if you made changes to the <lucene> element.
- Start the geoportal web application. If you created a new folder for the indexLocation, then the documents will be reindexed automatically since the lucene folder location changed. This may take some time, so do not be alarmed if immediately you do not see search results. If instead you cleared out the old index by deleting the index files, then the documents may need to be re-approved to be reindexed.