Skip To Content

Index All Metadata Content

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.
There are advantages to only indexing certain pieces of information. One is that the Lucene index will not be as large if only certain information is indexed. This facilitates faster searching. Also, some information included in metadata is not useful for text-based searching. For example, if the metadata record contains a thumbnail, there is no need to index the thumbnail binary section in the metadata because users are not going to search for characters within the binary. Also, specifying that only specific information be indexed provides control over the search results. A user searching for "New York" may want to retrieve results with "New York" in the title and abstract, not the Point of Contact's address information.

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.

  1. 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.
  2. Add a line before the closing </indexables> tag that reads:
     <property meaning="body" xpath="/rdf:RDF/rdf:Description/*"/>
  3. 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/*"
  4. Update the xpath attribute's value to support your profile of interest.
  5. Save the file indexables.xml.
  6. Repeat for each supported profile in your geoportal for which you want to index all content.
  7. Stop the geoportal web application.
  8. 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).
  9. 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.
  10. Save gpt.xml if you made changes to the <lucene> element.
  11. 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.