# Search

Ermöglicht eine schrittweise Suche nach einzelnen Elementen (z. B. Name, Strasse) mit der Möglichkeit, die Suchergebnisse sukzessive zu verfeinern. Im Gegensatz zur Match-Funktion ist hier kein vollständiger String erforderlich.

## Call Lookup

Ermittelt basierend auf einer Telefonnummer die dazugehörigen öffentlich publizierten Angaben (Name, Adresse etc.). Dies ist besonders nützlich für die Erkennung eingehender Anrufe in Systemen wie:

* Telefonieanlagen
* CRMs
* Helpdesk-Systemen

### Voraussetzungen für erfolgreiche Ergebnisse

* Die angegebene Telefonnummer muss in öffentlichen Verzeichnissen (local.ch oder search.ch) eingetragen und für die Rückwärtssuche freigegeben sein.
* Auch Nummern aus Durchwahlbereichen funktionieren, sofern sie rückwärts auflösbar sind.

## GET /Search/CallLookup

>

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"Multisource API","version":"1.0"},"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"},{"url":"https://api.multisource.ch","description":"Production"},{"url":"https://apitep.multisource.ch","description":"Pre-Production Testing"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","description":"Please enter a valid token","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/Search/CallLookup":{"get":{"tags":["Realtime - Search"],"parameters":[{"name":"source","in":"query","schema":{"type":"string"}},{"name":"number","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"object","properties":{"hitCount":{"type":"integer","format":"int32"},"resultCount":{"type":"integer","format":"int32"},"data":{"type":"array","items":{"type":"object","properties":{"companyname":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"houseNumber":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"mobile":{"type":"string","nullable":true}},"additionalProperties":false},"nullable":true}},"additionalProperties":false}},"application/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1CallLookup/get/responses/200/content/text~1plain/schema/properties"},"additionalProperties":false}},"text/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1CallLookup/get/responses/200/content/text~1plain/schema/properties"},"additionalProperties":false}}}}}}}}}
```

## Autocomplete

Die Autocomplete-Funktion vervollständigt Ihre Eingabe automatisch. Suchen Sie genauso, wie Sie es von Internet-Suchmaschinen gewohnt sind.

## GET /Search/Autocomplete

>

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"Multisource API","version":"1.0"},"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"},{"url":"https://api.multisource.ch","description":"Production"},{"url":"https://apitep.multisource.ch","description":"Pre-Production Testing"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","description":"Please enter a valid token","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/Search/Autocomplete":{"get":{"tags":["Realtime - Search"],"parameters":[{"name":"source","in":"query","schema":{"type":"string"}},{"name":"value","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"enum":[0,1,2],"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"object","properties":{"hitCount":{"type":"integer","format":"int32"},"resultCount":{"type":"integer","format":"int32"},"data":{"type":"array","items":{"type":"object","properties":{"companyname":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"houseNumber":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"location":{"type":"string","nullable":true}},"additionalProperties":false},"nullable":true}},"additionalProperties":false}},"application/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1Autocomplete/get/responses/200/content/text~1plain/schema/properties"},"additionalProperties":false}},"text/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1Autocomplete/get/responses/200/content/text~1plain/schema/properties"},"additionalProperties":false}}}}}}}}}
```

## Fulltext

Dieser Endpoint ist für umfassende Suchanfragen ausgelegt, bei denen mehrere Begriffe oder ein Volltextdurchlauf erforderlich sind.

1. `type`: Suchmodus
   1. `Exact`: Suche nach einem exakten Einzelwort.
   2. `Like`: Linksbündige Suche, die ab dem Beginn eines Einzelwortes erfolgt und Teilwörter im gesamten Wort berücksichtigt.
   3. `Phonetic`: Suche mit phonetischem Abgleich, um ähnliche Begriffe zu finden.
2. `source`: Datenquelle, in der gesucht wird. Verfügbare Optionen:
   1. `etc`
   2. `etb`
   3. `kbc`
   4. `kbb`
   5. `kbg`
3. `resultThreshold`: Mindestanzahl an Ergebnissen, die angezeigt werden sollen.
4. `resultMaximum`: Maximale Anzahl an Ergebnissen, die zurückgegeben werden.
5. `includeCount`: Gibt an, ob die Gesamtanzahl der Treffer in der Antwort enthalten sein soll (`true`/`false`).
6. `includeData`: Gibt an, ob Detailinformationen zu den Treffern ausgegeben werden sollen (`true`/`false`).
7. `search`: Suchbegriff oder Suchphrase.    &#x20;

## POST /Search/Fulltext

>

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"Multisource API","version":"1.0"},"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"},{"url":"https://api.multisource.ch","description":"Production"},{"url":"https://apitep.multisource.ch","description":"Pre-Production Testing"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","description":"Please enter a valid token","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/Search/Fulltext":{"post":{"tags":["Realtime - Search"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"enum":[0,1,2],"type":"integer","format":"int32"},"source":{"type":"string","nullable":true},"resultThreshold":{"type":"integer","format":"int32"},"resultMaximum":{"type":"integer","format":"int32"},"includeCount":{"type":"boolean"},"includeData":{"type":"boolean"},"search":{"type":"string","nullable":true}},"additionalProperties":false}},"text/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1Fulltext/post/requestBody/content/application~1json/schema/properties"},"additionalProperties":false}},"application/*+json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1Fulltext/post/requestBody/content/application~1json/schema/properties"},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"object","properties":{"hitCount":{"type":"integer","format":"int32"},"resultCount":{"type":"integer","format":"int32"},"data":{"type":"array","items":{"type":"object","properties":{"companyname":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"houseNumber":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"dwhId":{"type":"string","nullable":true}},"additionalProperties":false},"nullable":true}},"additionalProperties":false}},"application/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1Fulltext/post/responses/200/content/text~1plain/schema/properties"},"additionalProperties":false}},"text/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1Search~1Fulltext/post/responses/200/content/text~1plain/schema/properties"},"additionalProperties":false}}}}}}}}}
```

## Detail

Dieser Endpoint liefert die Detailergebnisse einer Suche basierend auf den angegebenen Parametern. Er eignet sich ideal für präzise Anfragen, bei denen sowohl die Anzahl der Treffer als auch die vollständigen Daten relevant sind.

## GET /Data/Detail

>

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"Multisource API","version":"1.0"},"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"},{"url":"https://api.multisource.ch","description":"Production"},{"url":"https://apitep.multisource.ch","description":"Pre-Production Testing"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","description":"Please enter a valid token","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/Data/Detail":{"get":{"tags":["Realtime - Data"],"parameters":[{"name":"dwhId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"array","items":{"type":"object","properties":{"companyname":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"houseNumber":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"dwhId":{"type":"string","nullable":true},"beac":{"type":"string","nullable":true},"recordType":{"type":"string","nullable":true},"matchRating":{"enum":[0,1,2,3],"type":"integer","format":"int32"},"language":{"type":"string","nullable":true},"salutation":{"type":"string","nullable":true},"acadTitel":{"type":"string","nullable":true},"acadTitelLabel":{"type":"string","nullable":true},"company2":{"type":"string","nullable":true},"company3":{"type":"string","nullable":true},"careof1":{"type":"string","nullable":true},"careOf2":{"type":"string","nullable":true},"streetAdditional":{"type":"string","nullable":true},"zip6":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"postBoxFlag":{"type":"boolean"},"postBox":{"type":"string","nullable":true},"postBoxText":{"type":"string","nullable":true},"postBoxZip":{"type":"string","nullable":true},"postBoxZip6":{"type":"string","nullable":true},"postBoxLocation":{"type":"string","nullable":true},"addressLabel1":{"type":"string","nullable":true},"addressLabel2":{"type":"string","nullable":true},"addressLabel3":{"type":"string","nullable":true},"addressLabel4":{"type":"string","nullable":true},"addressLabel5":{"type":"string","nullable":true},"addressLabel6":{"type":"string","nullable":true},"letterSalutation":{"type":"string","nullable":true},"meta":{"type":"object","properties":{"updateAvailable":{"type":"boolean"},"criterias":{"type":"array","items":{"type":"object","properties":{"dwhCriteriaId":{"type":"string","nullable":true},"criteriaDescription":{"type":"object","additionalProperties":{"type":"string","nullable":true},"nullable":true},"valueAvailable":{"type":"boolean"}},"additionalProperties":false},"nullable":true}},"additionalProperties":false}},"additionalProperties":false}}},"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"$ref":"#/paths/~1Data~1Detail/get/responses/200/content/text~1plain/schema/items/properties"},"additionalProperties":false}}},"text/json":{"schema":{"type":"array","items":{"type":"object","properties":{"$ref":"#/paths/~1Data~1Detail/get/responses/200/content/text~1plain/schema/items/properties"},"additionalProperties":false}}}}}}}}}}
```
