Returns all infra objects of some type according to a hierarchical query.
Payload
{
"object": string,
"query": query,
"dry": boolean, # default: false
}
Where:
- object can be any search object declared in search.yml
- query is a JSON document which can be deserialized into a [search::SearchAst]. Check out examples below.
Response
The response structure depends on the object.
Query language
The query itself is defined using a language made up of nested JSON arrays. It will be parsed and transformed into a PostgreSQL WHERE statement. The language consist of a single boolean expression of comparison statements in prefix notation. For example, the query ["like", ["name"], "%ari%"] will generate a WHERE statement like WHERE "name" LIKE '%ari%'. For more information on the query language itself, check out examples below.
Available functions
See [search::create_processing_context()].
A few query examples
- The railway station PNO: ["=", ["trigram"], "pno"]
- The railway stations with either "Paris" or "Lyon" (or both) in their name: ["or", ["search", ["name"], "Paris"], ["search", ["name"], "Lyon"]]
- All railway stations with "Paris" in their name but not PNO : ["and", ["search", ["name"], "Paris"], ["not", ["=", ["trigram"], "pno"]]]
See [search::SearchAst] for a more detailed view of the query language.
Query parameters
Request body
Example request
{
"object": "operationalpoint",
"query": [
"and",
[
"like",
[
"to_string",
[
"infra_id"
]
],
2
],
[
"search",
[
"name"
],
"plop"
]
]
}Response
The search results
Example response
[
{
"margins": {
"values": [
"5%",
"2min/100km"
]
},
"schedule": [
{
"arrival": "PT2H",
"reference_base_arrival": "PT2H",
"stop_for": "PT2H"
}
]
}
]Changes
Changed in 32 of the 77 revisions of this API.11617121
- ○
added the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/can_backtrackto the response with the200statusresponse-optional-property-added
This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ●
removed the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/can_backtrackfrom the response with the200statusresponse-optional-property-removed
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ●
- ○
added the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/can_backtrackto the response with the200statusresponse-optional-property-added
This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ▲
added
subschema #2: OperationalPointReferenceDomesticto theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-added
- ○
removed
subschema #2: OperationalPointReferenceTrigramfrom theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-removed
- ○
added the required property
items/oneOf[subschema #2: SearchResultItemSearchResultItemOperationalPoint]/oneOf[SearchResultItemOperationalPoint]/country_codeto the response with the200statusresponse-required-property-added
- ▲
- ▲
added
subschema #2: OperationalPointReferenceTrigramto theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-added
- ▲
removed the required property
items/oneOf[subschema #2: SearchResultItemSearchResultItemOperationalPoint]/oneOf[SearchResultItemOperationalPoint]/country_codefrom the response with the200statusresponse-required-property-removed
- ●
removed the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/can_backtrackfrom the response with the200statusresponse-optional-property-removed
- ○
removed
subschema #2: OperationalPointReferenceDomesticfrom theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-removed
This revision also has 12 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
added
subschema #2: OperationalPointReferenceDomesticto theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-added
- ○
added the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/can_backtrackto the response with the200statusresponse-optional-property-added
- ○
removed
subschema #2: OperationalPointReferenceTrigramfrom theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-removed
- ○
added the required property
items/oneOf[subschema #2: SearchResultItemSearchResultItemOperationalPoint]/oneOf[SearchResultItemOperationalPoint]/country_codeto the response with the200statusresponse-required-property-added
This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
added
subschema #2: OperationalPointReferenceTrigramto theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-added
- ▲
removed the required property
items/oneOf[subschema #2: SearchResultItemSearchResultItemOperationalPoint]/oneOf[SearchResultItemOperationalPoint]/country_codefrom the response with the200statusresponse-required-property-removed
- ○
removed
subschema #2: OperationalPointReferenceDomesticfrom theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-removed
This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
added
subschema #2: OperationalPointReferenceDomesticto theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-added
- ○
removed
subschema #2: OperationalPointReferenceTrigramfrom theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-removed
- ○
added the required property
items/oneOf[subschema #2: SearchResultItemSearchResultItemOperationalPoint]/oneOf[SearchResultItemOperationalPoint]/country_codeto the response with the200statusresponse-required-property-added
- ▲
- ○
added the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/reference_base_arrivalto the response with the200statusresponse-optional-property-added
- ○
added the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/reference_positionto the response with the200statusresponse-optional-property-added
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ▲
added
subschema #2: OperationalPointReferenceTrigramto theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-added
- ▲
removed the required property
items/oneOf[subschema #2: SearchResultItemSearchResultItemOperationalPoint]/oneOf[SearchResultItemOperationalPoint]/country_codefrom the response with the200statusresponse-required-property-removed
- ●
removed the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/can_backtrackfrom the response with the200statusresponse-optional-property-removed
- ●
removed the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/reference_base_arrivalfrom the response with the200statusresponse-optional-property-removed
- ●
removed the optional property
items/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/schedule/items/reference_positionfrom the response with the200statusresponse-optional-property-removed
- ○
removed
subschema #2: OperationalPointReferenceDomesticfrom theitems/oneOf[subschema #7: SearchResultItemSearchResultItemTrainSchedule]/oneOf[SearchResultItemTrainSchedule]/path/items/location/oneOf[subschema #2: PathItemLocationOperationalPointPartReference]/allOf[OperationalPointPartReference]/operational_pointresponse propertyoneOflist for the response status200response-property-one-of-removed
This revision also has 12 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
Of the 77 revisions, 2 have no diff computed.