GeoNetwork opensource
  • Overview
    • About
    • License
    • Author
      • Project Steering Committee (PSC)
      • Committers
      • Contributors
      • The documentation
    • Change log
      • Version 3.0.0
      • Version 3.0.1
      • Version 3.0.2
      • Version 3.0.3
      • Version 3.0.4
      • Version 3.2.0
      • Version 3.2.1
      • Version 3.2.2
      • Version 3.4.0
      • Version 3.4.1
      • Version 3.4.2
      • Version 3.4.3
      • Version 3.4.4
      • Version 3.6.0
      • Version 3.8.0
      • Version 3.8.1
      • Version 3.8.2
      • Version 3.8.3
      • Version 3.10.0
      • Version 3.10.1
      • Version 3.10.2
      • Version 3.10.3
      • Version 3.10.4
      • Version 3.10.5
      • Version 3.10.6
      • Version 3.10.7
      • Version 3.10.8
      • Version 3.10.9
      • Version 3.10.10
      • Version 3.12.0
      • Version 3.12.1
      • Version 3.12.2
      • Version 3.12.3
      • Version 3.12.4
      • Version 3.12.5
      • Version 3.12.6
      • Version 3.12.7
      • Version 3.12.8
      • Version 3.12.9
  • Installation guide
    • Installing using a ZIP file
    • Installing using a WAR file
    • Building from Source Code
      • System Requirements
      • Tools
      • Building & Running
    • Installing a third-party distribution
    • Installing remote index
      • Manual installation
      • Install using Maven
      • Check installation
      • Configure connection
    • Configuring the database
      • Introduction
      • H2 database
      • Configuring a database via config files
      • Configuring a database via JNDI
      • Configuring a database via environment
      • Logging
      • Summary
    • Customizing the data directory
      • Creating a new data directory
      • Setting the data directory
      • Java System Property
      • Bean configuration
      • Using a S3 object storage
      • Structure of the data directory
      • Advanced data directory configuration
      • Check the configuration
    • Logging
      • Customising the log file location
      • Setting the Loglevel
      • Log4j
    • Using multinode mode
      • Overview
      • Configuration
    • Configuring printing of the map
    • Loading templates and sample data
      • Signing in and loading templates
  • User guide
    • Quick start
      • Starting the catalog
      • Signing in and load templates
      • Searching information
      • Discovering information
    • Maps and dataset visualisation
      • Map viewer
      • Storing and sharing maps
    • Describing information
      • Managing templates
      • Creating a new record
      • Importing a new record
      • Editing metadata
      • Deleting a record
      • Multilingual editing
      • Describing resources for the INSPIRE directive
      • Migrating from Technical guidance version 1.3 to version 2.0
    • Associating resources
      • Associating documents
      • Associating another record
      • Digital Object Identifier (DOI)
    • Classify information
      • Tagging with categories
      • Tagging with keywords
    • Publishing
      • Managing privileges
      • Setting Privileges
      • Restricting information to metadata sections
      • Transferring privileges
    • Analyzing data
      • Statistics on catalog content
      • Analyze and visualize data
    • Workflow
      • Validating records
      • Suggestion for improving metadata content
      • Life cycle
      • Publishing GIS data in a map server
      • Versioning
      • Updating a set of records
    • Harvesting
      • GeoNetwork 2.0 Harvester
      • Harvesting CSW services
      • Harvesting OGC Services
      • Local File System Harvesting
      • WEBDAV Harvesting
      • OAIPMH Harvesting
      • Harvesting an ARCSDE Node
      • GeoPortal REST Harvesting
      • THREDDS Harvesting
      • WFS GetFeature Harvesting
      • Z3950 Harvesting
      • Mechanism overview
      • Harvesting life cycle
      • Multiple harvesting and hierarchies
      • Harvesting Fragments of Metadata to support re-use
      • HTTPS support
      • The main page
      • Harvesting Status and Error Icons
      • Harvesting result tips
      • Adding new harvesters
      • Harvest History
    • Exporting records
      • Export as a ZIP archive
      • Export as a CSV file
  • Administrator guide
    • Configuring the catalog
      • System configuration
      • User Interface Configuration
      • Configuring CSS & Style
      • Configuring CSW
      • Portal configuration
      • Configuring virtual CSW
      • Configuring for the INSPIRE Directive
      • Map servers configuration for geopublication
    • Managing users and groups
      • Creating group
      • Creating user
      • User Self-Registration
      • Authentication mode
      • Default user
      • User session
      • Users, Groups and Roles
    • Managing classification system
      • Managing categories
      • Managing directories
      • Managing thesaurus
    • Managing metadata & template
      • Managing metadata standards
      • Configuring validation levels
      • Configuring metadata identifier
  • Maintainer guide
    • Setting up search/content statistics
      • Setup ElasticSearch
      • Setup Kibana
      • Setup GeoNetwork
    • Production use
      • Database
      • Java container
      • Data folder
      • Memory
      • Scaling
      • GeoNetwork and Docker
      • Web Proxy
      • WEB
  • API guide
    • GeoNetwork API
      • Using the API to apply an XSL process
      • Building client for the API using codegen
      • Connecting to the API with python
    • Catalog Service for the Web (CSW)
      • Configuration
      • URL
      • Requests
    • OpenSearch and INSPIRE ATOM
      • OpenSearch
      • INSPIRE ATOM
    • Q Search
      • Query results parameters
      • Query filter parameters
      • Date Searches
      • Query examples
    • RDF DCAT end point
      • URLS
      • Query parameters
    • Open Archive Initiative (OAI)
      • Configuration
      • Requests
    • Z39-50
  • Contributing guide
    • Writing documentation
      • Building the docs
      • Building the standards docs
      • Editing the reStructuredText files
      • Sphinx
      • Translating the doc
    • Style Guide
      • Preferred Terminology
    • Translating the application
    • Translating a standard
    • Making a pull request
    • Doing a GeoNetwork release
  • Customizing guide
    • Search application
      • Create your own view
      • Change default view configuration
      • Create your own view
      • Enrich your custom view
      • Wro4j resource management
    • Customizing metadata views
    • Customizing editor
      • Defining field type
      • Grouping element from the standards
      • Defining multilingual fields
      • Configuring views
      • Defining a view
      • Defining a tab
      • Adding a section to a tab
      • Adding a field
      • Adding a template based field
      • Adding documentation or help
      • Adding a button
      • Adding a group
    • Theming
    • Configuring search fields
      • Add a search field
      • Boosting documents and fields
      • Boosting search results
    • Configuring faceted search
      • Facet principle
      • Facet response when searching
      • Configuration
    • Advanced configuration
      • User session timeout configuration
    • Adding static pages
      • Examples of API usage
    • Implementing schema plugins
      • Metadata schemas and profiles
      • Implementing a metadata schema or profile
      • Schema Plugins
    • Characterset
    • Miscellaneous
      • Invalid CSRF Token
      • Using the H2 database
  • Tutorials
    • Introduction to GeoNetwork
      • Deployment
      • Setup
      • Editing Metadata
      • Harvesting
    • Customize your GeoNetwork UI
      • Search page
      • Formatter
    • Hook your own code
      • Separate your code
      • Using Events
      • Adding new User Interface
      • Schema Plugins
      • Search Fields
    • Tutorials
      • Tutorial setting up INSPIRE view service with GeoNetwork and GeoServer
      • Tutorial setting up INSPIRE view service with GeoNetwork and Mapserver
      • Tutorial setting up an Atom/OpenSearch based INSPIRE download service
      • Tutorial setting up a WFS based INSPIRE download service with GeoServer
  • Annexes
    • Metadata Exchange Format (MEF)
    • Some GeoNetwork nodes
    • Glossary
    • Standards
      • Geographic information – Metadata (iso19115-3.2018)
      • Geographic information – Metadata (iso19139:2007) (iso19139)
      • Geographic information – Methodology for feature cataloguing (iso19110)
      • Dublin core (dublin-core)
 
GeoNetwork opensource
  • Docs »
  • API guide »
  • Q Search
  • Edit on GitHub

Q Search¶

The Q Search endpoint allows you to query the catalog programmatically. It is available in the local catalog at http://localhost:8080/geonetwork/srv/eng/q (otherwise substitute your catalog URL).

Query results parameters¶

The following parameters can be appended to your request to format the results:

  • _content_type=json: returns results in json format. If this parameter is not provided, then the results are returned in xml format.

  • sortBy: sorts the results by different criteria (example: sortBy=relevance):

    • relevance (default sorting method if not provided)

    • title (metadata title)

    • changeDate (metadata datestamp)

    • rating

    • popularity

    • denominatorDesc

    • denominatorAsc

  • sortOrder=reverse: Used to sort alphabetically. Note this will sort in ASCENDING order (eg A - Z)

  • from, to: Used to return a subset of the results, usually for pagination (example: from=1&to=20)

  • fast: Used to indicate the information to return. Possible values:

    • index: returns the metadata information from the Lucene index (a subset of the information). In most cases this is the best option as the retrieval of information from the Lucene index is very fast.

      The fields returned are configured in the dumpFields section in https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webapp/WEB-INF/config-lucene.xml#L107

    • false: returns the raw (full) metadata. This is slower as it will retrieve every metadata attribute from the database. If this parameter is not provided, it returns a minimal set of information for each record: uuid, internal id, metadata schema, create/change dates

  • buildSummary: Returns a summary element with search facets that can be used to filter the metadata, typically used to provide quick filters (facets) on the search results page. Values:

    • true (default, if the parameter is not provided).

    • false: does not return the summary.

  • summaryOnly: Returns the summary (depending on the value of the parameter buildSummary) and results. Values:

    • 0 (default, if the parameter is not provided).

    • Any other value returns the summary only.

  • resultType: type of summary to return. Summaries are configured in the summaryTypes section in https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webapp/WEB-INF/config-summary.xml#L132-L249

    • hits (default value if not provided), returns the fields configured in the hits section in https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webapp/WEB-INF/config-summary.xml#L185

    • details (recommended value to send), returns the fields configured in the details section in https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webapp/WEB-INF/config-summary.xml#L133

  • extraDumpFields: a comma-separated list of additional fields that you wish to return alongside the fields returned according to the resultType you have chosen. The wildcard character * can be used to match multiple fields. For example extraDumpFields=mycustomfield* would match mycustomfield1 and mycustomfield2.

  • Other values in the summaries section are allowed

Query filter parameters¶

You can search on any field(s) indexed in Lucene. For a complete reference see https://github.com/geonetwork/core-geonetwork/blob/master/schemas/iso19139/src/main/plugin/iso19139/index-fields/default.xsl

Note you can query the Lucene index graphically,using a Java-based graphical tool such as Luke. Version 4.10.4 is required to work with the version of Lucene bundled with GeoNetwork. Download the jar file where you can access the GeoNetwork index files, then execute with:

java -jar luke-with-deps.jar

Then follow the instructions in the tool.

Most relevant fields:

  • any: A special Lucene field that indexes all the text content in the metadata. Example: http://localhost:8080/geonetwork/srv/eng/q?any=water&from=1&to=20&resultType=details&fast=index&_content_type=json

There are some additional query fields, that use the content from the Lucene field any.

  • or: extract the tokens of the query parameter to return the results that contain at least 1 of the tokens

  • without: extract the tokens of the query parameter to return the results that don’t contain any of the tokens.

  • phrase: return the results that contain the exact text as provided in the search query parameter.

  • title: metadata title.

  • abstract: metadata abstract.

  • topicCat: metadata topic categories.

  • keyword: metadata keywords.

  • type: hierarchyLevel (dataset, service, etc.)

If several tokens are included in the query, an AND query with all the tokens is executed. For example, title=roads&topicCat=biota. This query will return the results that contain roads in the title AND have the topic category biota.

An OR query of several fields can be executed using the format: field1_OR_field2_OR_... =value. For example, title_OR_abstract=roads returns the metadata that contain roads in the title OR the abstract.

Additionally an OR query of several values for a single field can be executed, if the Lucene configuration for that field allows it, with the following format: field=value1 or value2 or ... For example topicCat=biota or farming, returns the metadata where the topic category is either biota OR farming. If the query was executed as topicCat=biota&topicCat=farming then only the metadata with BOTH topic categories would be returned.

Date Searches¶

There are a number of ways that you can search by date. Date searches should be of the form YYYY-MM-DD

  • dateFrom/dateTo: uses the changeDate parameter in the index.

  • creationDateFrom/To: uses the creation date.

  • revisionDateFrom/To: uses the revision date.

Query examples¶

Query with any field for metadata containing the string “infrastructure”, returning json, using the fast index to return results, and returning the fields configured in config-summary.xml:

http://localhost:8080/geonetwork/srv/eng/q?any=infrastructure&_content_type=json&fast=index&from=1&resultType=details&sortBy=relevance&to=20

Query datasets with title containing the string “infrastructure”, returning json, using the fast index to return results, returning the fields configured in config-summary.xml and returning only the first 20 results (ordered by relevance):

http://localhost:8080/geonetwork/srv/eng/q?title=infrastructure&type=dataset&_content_type=json&fast=index&from=1&resultType=details&sortBy=relevance&to=20

Query datasets with a revision date in June 2019 using the fast index to return results, returning the fields configured in config-summary.xml and returning only the first 20 results (ordered by relevance):

http://localhost:8080/geonetwork/srv/eng/q?_content_type=json&revisionDateFrom=2019-06-01&revisionDateTo=2019-06-30&fast=index&from=1&resultType=details&sortBy=relevance&to=20

Next Previous

© Copyright 2001-2023, GeoNetwork opensource. Licensed under Creative Commons Attribution ShareAlike (Unported) v3.0 License.

Built with Sphinx using a theme provided by Read the Docs.