at-gmbh / personio-py

a lightweight Personio API client
https://at-gmbh.github.io/personio-py
Apache License 2.0
26 stars 17 forks source link

Provide a search function for employees #17

Closed klamann closed 3 years ago

klamann commented 3 years ago

We should provide a search function so that employees can be easily found by name, position, and possibly other text attributes. It should work like a full text search function, maybe with regex support.

Because the Personio API does not provide a search endpoint, we need to build a cache of all employees, index the attributes that we are interested in and implement the search function on that index. In the easiest case, this could just be a mapping from supported search terms to the employee, which we can use for string matching.

The cache should be built on the fly when a search is requested and it should stay alive for subsequent calls to the search function. It will be invalidated whenever an employee is created or updated, or after a certain amount of time has passed (to account for possible changes by other users on the server). It will not be preserved on disk. The cache will not be used to speed up other requests except for the search function (we do not want to deal with inconsistencies caused by this cache). We will not guarantee that the search function will always run on the latest state of information (just like any other search engine).

klamann commented 3 years ago

resolved in #19