opensearch field types - procure-project/EU-Contract-Hub GitHub Wiki
Field Types and Mappings Guide
Overview
Understanding field types and mappings is essential for effective data analysis in the EU Contract Hub. Fields determine how procurement data is stored, searched, and retrieved within the platform.
Each field in the procurement database has a specific type (such as text, number, or date) that defines what kind of data it can contain and how it behaves in searches. Proper field mapping ensures your search queries return accurate and relevant results.
This guide explains the common field types you'll encounter when searching and analyzing procurement data.
Field Types
Basic Types
Text Fields
Text fields store textual content like contract titles, descriptions, and company names. They support full-text search capabilities essential for procurement analysis.
- keyword: Exact-match text fields used for filtering, sorting, and aggregations
- Examples: Country codes, CPV codes, procurement procedure types
- Best for: Filtering by exact values, creating facets, sorting results
- text: Analyzed text fields that enable full-text search
- Examples: Contract titles, descriptions, authority names
- Best for: Finding contracts containing specific terms or phrases
To search a keyword field for an exact match:
Country:France
To search a text field for words or phrases:Title:"medical equipment"
Boolean Fields
These field types serve specific analytical purposes in procurement data:
- boolean: True/false flags
- Examples: Healthcare indicator, critical service marker, SME status
To filter healthcare-related contracts:
HealthcareTrue:true
Numeric Fields
Numeric fields store quantities, measurements, and financial values critical for procurement analysis.
- integer: Whole numbers without decimal points
- Examples: Lot counts, document reference numbers, year values
- long: Larger whole number values
- Examples: Internal IDs, larger counts
- float/double: Decimal numbers with varying precision
- Examples: Contract values, percentage metrics
- scaled_float: Optimized decimal numbers for monetary values
- Examples: Standardized contract values, budget amounts
To search for contracts with a specific value:
Value:1500000
To find contracts within a value range:Value:[1000000 TO 5000000]
Date Fields
Date fields store temporal information, enabling chronological analysis of procurement activities.
- date: Timestamp values for events and deadlines
- Examples: Publication dates, submission deadlines, award dates
- Supports multiple formats (ISO 8601 preferred)
- Enables range queries and chronological sorting
To search for contracts published on a specific date:
PublicationDate:2023-06-15
To find contracts within a date range:PublicationDate:[2023-01-01 TO 2023-06-30]
Complex Types
Object Fields
Object fields store structured data with multiple subfields, appearing as a single unit in the database.
- Properties: Each object contains named properties (subfields)
- Example: Authority contact information with name, email, and phone properties
- Nesting Level: Objects can be nested within other objects
- Example: Address objects containing street, city, and postal code properties
To search within object properties:
Authority.Name:"Ministry of Health"
Nested Fields
Nested fields store arrays of objects that maintain relationships between their properties, allowing for more complex queries.
- Independence: Each object in the array is indexed independently
- Query Isolation: Conditions must match within the same nested object
- Common Use Case: Contract lots, where each lot has its own properties
To search for contracts with specific lot criteria:
Lots.Value:>100000 AND Lots.Title:pharmaceutical
How to Use
1. Field Configuration
When using the EU Contract Hub, the field types are already configured for optimal procurement data analysis. Understanding these configurations helps you build more effective queries. The platform uses appropriate field types for different procurement data:
- Text fields for descriptive content
- Numeric fields for values and quantities
- Date fields for temporal analysis
- Complex types for structured data like lots and contracting authorities
For a complete reference of available fields and their types, consult the Data Fields Reference guide.