pelias / pelias/api

Is there documentation for `/search` endpoint middlewares?

Open
#1,067 2 comments 0 reactions 1 assignee View on GitHub

@trescube is already working on this.

Since Nov 22, 2017.

Dominant language
JavaScript
Stars
259
Forks
169
Avg merge
6h 15m
Merged PRs (30d)
1

Description

Hi there,
there are bunch of middlewares that are used in /search endpoint. For our purposes we want to modify them a bit, but we realized that it's quite difficult to understand what actually these middlewares are used for and how they all are working with each other.

Do you have documentation for this logic?

Something like:

1. sanitize parameters (convert comma-separated values to arrays, validate country code, etc.)
2. validate language parameter if exists (use https://github.com/florrain/locale library)
3. validate size parameter if exists
4. libpostal middleware
    execute 
       if there are no errors in request
       if source parameter is not "whosonfirst"
    perform "parse_text" function and return hash with categorized query terms, for example:
    "ettlinger strasse 10" => { street: "ettlinger strasse", "number": 10 }
5. ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.