> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.jarvi.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Ricerca

> Filtrare profili, aziende e progetti su campi indicizzati con l'operatore _search

## Perché `_search`

Jarvi fa girare un motore di ricerca full-text sui tuoi dati. Nomi, email, numeri di telefono, titoli di lavoro, competenze e valori dei campi personalizzati sono indicizzati, e `_search` interroga quegli indici.

Filtrare con `_ilike "%termine%"` fa tutt'altro: PostgreSQL scorre ogni record del tuo spazio e lo confronta con il pattern. Su una base di produzione, un solo `_ilike` su un cognome è stato misurato a 2,4 secondi; la stessa ricerca tramite l'indice risponde in qualche decina di millisecondi.

<Warning>
  `_ilike`, `_like`, `_nilike` e `_nlike` saranno ritirati dall'API pubblica il **31 luglio 2027**.

  Sugli endpoint REST non devi fare nulla: i filtri `_ilike` vengono già tradotti in una ricerca
  indicizzata al posto tuo, e la risposta indica quale filtro ha sostituito il tuo. Tramite
  l'endpoint `/graphql` la query è tua e può puntare a qualunque tabella, quindi sta a te cambiarla.
</Warning>

## Usare l'operatore

Un filtro prende il nome di un bersaglio di ricerca e un termine:

```json theme={null}
{ "quickSearch": { "_search": "Dupont" } }
```

Combinane più d'uno con `_and`, `_or` e `_not`, come con qualsiasi altro filtro:

```json theme={null}
{
  "_and": [
    { "globalSearch": { "_search": "javascript" } },
    { "isTalent": true },
    { "addedAt": { "_gte": "2026-01-01" } }
  ]
}
```

### Sintassi della query

Il termine è esso stesso una query, non una semplice stringa:

| Sintassi                         | Corrisponde a                                                        |
| -------------------------------- | -------------------------------------------------------------------- |
| `developer designer`             | una delle due parole                                                 |
| `developer AND designer`         | entrambe le parole                                                   |
| `developer AND (java OR kotlin)` | entrambe, con l'una o l'altra tecnologia                             |
| `NOT intern`                     | i record senza quella parola                                         |
| `"project manager"`              | la frase esatta, in quell'ordine                                     |
| `java^10 python`                 | entrambe le parole, con java che pesa dieci volte di più nel ranking |

### Parole intere, non frammenti

I nomi sono indicizzati parola per parola, dall'inizio: `Dupo` trova *Dupont*, `upont` no. Lo stesso vale per i nomi di aziende e progetti.

Email e numeri di telefono sono indicizzati diversamente e accettano un frammento in qualsiasi posizione: un numero si ritrova dalle ultime cifre, un'email dal suo dominio.

## I filtri, risorsa per risorsa

Tutti i filtri qui sotto si appoggiano a un indice. Le altre colonne e relazioni Hasura restano accettate, ma non sono né ottimizzate né garantite.

### Profiles

| Filter                                 | Operators                         | What it matches                                                                                                                                                                                                                          |
| -------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `quickSearch`                          | `_search`                         | Searches name, email, phone and short id — the target for simple person or name lookups.                                                                                                                                                 |
| `globalSearch`                         | `_search`                         | Searches name, headline, summary, position titles, company names, skills, educations and custom field values — the target for skill, role or technology searches.                                                                        |
| `emailPhoneAndNameSearch`              | `_search`                         | Searches name, email, phone and short id — the target for simple person or name lookups.                                                                                                                                                 |
| `fullPositionTitleSkillsAndTagsSearch` | `_search`                         | Searches name, headline, summary, position titles, company names, skills, educations and custom field values — the target for skill, role or technology searches.                                                                        |
| `headline`                             | `_search`                         | Headline of the profile: the tagline shown under the name on LinkedIn, or the summary line extracted from the CV for profiles that have no LinkedIn page. Editable by hand only when the profile has no LinkedIn identifier.             |
| `currentPositions.global`              | `_search`                         | Full-text over title, description                                                                                                                                                                                                        |
| `currentPositions.global.title`        | `_search`                         | Job title held at this position, coming from LinkedIn, from a parsed CV or entered by hand. This is the main field behind job title search.                                                                                              |
| `currentPositions.global.description`  | `_search`                         | What the person wrote about this role on their profile or CV. Often empty on imported records.                                                                                                                                           |
| `emails`                               | `_search`                         | Email address of the profile or the company it belongs to. Normalized on save: lowercased, and when the input is not a clean address the first valid one found inside it is kept, the row being dropped if there is none.                |
| `phones`                               | `_search`                         | Phone number search. Only the digits are compared, so a number matches whatever spacing, separators or country prefix it was typed with, and a suffix matches too.                                                                       |
| `profiles.shortId`                     | `_search`                         | Short readable reference for the profile — what users type in quick search and what appears on generated documents. Assigned once at creation and never changes.                                                                         |
| `historyEntries`                       | `_search`                         | Full-text over subject, message                                                                                                                                                                                                          |
| `historyEntries.subject`               | `_search`                         | Subject of the interaction: the email subject, the meeting title, or the job offer title. Empty for channels that carry no subject, such as LinkedIn messages, WhatsApp and SMS.                                                         |
| `historyEntries.message`               | `_search`                         | Content of the interaction: the email body, the text of the LinkedIn, WhatsApp, SMS or Telegram message, or what the recruiter typed for a manual note.                                                                                  |
| `historyEntries.type`                  | `_eq`, `_in`, `_is_null`          | What kind of interaction this entry records: emails, LinkedIn messages and InMails, connection invitations, SMS, WhatsApp, Telegram, phone calls, scheduled meetings, job applications, or a free note.                                  |
| `historyEntries.subTypeId`             | `_eq`, `_in`, `_is_null`          | Optional sub-category of the interaction, defined by the group itself — naming its own kinds of notes or calls, for instance. Each sub-category belongs to a single parent type.                                                         |
| `historyEntries.occurredAt`            | `_eq`, `_gte`, `_lte`, `_is_null` | Single date used to place the interaction on the timeline: the meeting start for a scheduled event, the creation date otherwise. Maintained by a trigger.                                                                                |
| `historyEntries.userId`                | `_eq`, `_in`, `_is_null`          | Jarvi user this entry belongs to. Determines the group the entry is attached to, and is used as its sender by default.                                                                                                                   |
| `historyEntries.hasFiles`              | `true`, `false`                   | The profile has at least one interaction carrying an attached file.                                                                                                                                                                      |
| `historyEntries.hasRecording`          | `true`, `false`                   | The profile has at least one interaction with a meeting recording.                                                                                                                                                                       |
| `customField`                          | `_search`                         | Value of a custom field. Target one field by suffixing its id, as in "customField.\<fieldId>".                                                                                                                                           |
| `location`                             | `_near`                           | Geographic search. Use range 0 for an exact city or region match, or a radius in meters.                                                                                                                                                 |
| `hasEmail`                             | `true`, `false`                   | The profile has at least one email address.                                                                                                                                                                                              |
| `hasEmailType`                         | `_eq`, `_in`, `_is_null`          | The profile has an email address of this type. Takes the same values as the type of an email address.                                                                                                                                    |
| `hasPhone`                             | `true`, `false`                   | The profile has at least one phone number.                                                                                                                                                                                               |
| `hasValidPhone`                        | `true`, `false`                   | The profile has at least one phone number not marked as invalid.                                                                                                                                                                         |
| `hasLocation`                          | `true`, `false`                   | The profile has at least one location.                                                                                                                                                                                                   |
| `hasPhoneType`                         | `_eq`, `_in`, `_is_null`          | The profile has a phone number of this type. Takes the same values as the type of a phone number.                                                                                                                                        |
| `hasWhatsApp`                          | `true`, `false`                   | The profile has a phone number reachable on WhatsApp.                                                                                                                                                                                    |
| `isTalent`                             | `true`, `false`                   | The profile is a talent — someone you recruit, followed in the ATS. A profile can be a talent and a contact at once.                                                                                                                     |
| `isContact`                            | `true`, `false`                   | The profile is a contact — a client or a hiring manager, followed in the CRM. A profile can be a contact and a talent at once.                                                                                                           |
| `hasLinkedin`                          | `true`, `false`                   | The profile is matched to a LinkedIn account.                                                                                                                                                                                            |
| `hasResume`                            | `true`, `false`                   | The profile has at least one CV attached.                                                                                                                                                                                                |
| `isConnectedOnLinkedinWithMe`          | `true`, `false`                   | The calling user is connected with this profile on LinkedIn, as recorded in the profile's history.                                                                                                                                       |
| `hasReplied`                           | `true`, `false`                   | The profile has answered at least once, on any channel.                                                                                                                                                                                  |
| `hasScheduledMessage`                  | `true`, `false`                   | A message or a connection invitation is still waiting to be sent to this profile.                                                                                                                                                        |
| `hasUnreadMessagesNotifications`       | `true`, `false`                   | The profile has an unread message notification.                                                                                                                                                                                          |
| `firstPositionStartDate`               | `_eq`, `_gte`, `_lte`, `_is_null` | Start date of the earliest position on the profile — the usual way to reason about years of experience.                                                                                                                                  |
| `lastPositionStartDate`                | `_eq`, `_gte`, `_lte`, `_is_null` | Start date of the current position, that is the one with no end date.                                                                                                                                                                    |
| `currentPositions.companyId`           | `_eq`, `_in`, `_is_null`          | The profile currently works at this company. Takes the identifier of the LinkedIn company page, not a Jarvi company id.                                                                                                                  |
| `projectId`                            | `_eq`, `_in`, `_is_null`          | The profile is associated with this project.                                                                                                                                                                                             |
| `statusId`                             | `_eq`, `_in`, `_is_null`          | Status of the profile. A parent status also matches profiles carrying any of its children, and the search is narrowed by the project or entity given in the context. Pass "other" for profiles whose status has no parent.               |
| `hasProject`                           | `true`, `false`                   | The profile is associated with at least one project.                                                                                                                                                                                     |
| `projectCount`                         | `_eq`, `_gte`, `_lte`, `_is_null` | How many distinct projects the profile is associated with.                                                                                                                                                                               |
| `emptyCustomFields`                    | `_all`, `_in`                     | Custom field UUIDs. \_all requires every field, \_in requires any of them.                                                                                                                                                               |
| `filledCustomFields`                   | `_all`, `_in`                     | Custom field UUIDs. \_all requires every field, \_in requires any of them.                                                                                                                                                               |
| `isInCrm`                              | `true`, `false`                   | The profile is followed in the CRM, meaning it is a contact. Same as isContact.                                                                                                                                                          |
| `isInAts`                              | `true`, `false`                   | The profile is followed in the ATS, meaning it is a talent. Same as isTalent.                                                                                                                                                            |
| `hasAttachedFiles`                     | `true`, `false`                   | The profile has at least one attached file.                                                                                                                                                                                              |
| `isOpenToNewOpportunities`             | `true`, `false`                   | The profile is flagged as open to new opportunities.                                                                                                                                                                                     |
| `isHiring`                             | `true`, `false`                   | The profile is flagged as hiring.                                                                                                                                                                                                        |
| `id`                                   | `_eq`, `_in`, `_is_null`          | Jarvi identifier of the profile, used in the public API and in app URLs.                                                                                                                                                                 |
| `createdAt`                            | `_eq`, `_gte`, `_lte`, `_is_null` | Technical timestamp of the row creation. For the date the profile entered the base, use addedAt (added\_at) instead.                                                                                                                     |
| `addedAt`                              | `_eq`, `_gte`, `_lte`, `_is_null` | Date the profile entered the group's base — what recruiters read as "added on". Set automatically when the profile is created or restored, unless the caller provides its own value, which is what imports do to keep the original date. |
| `externalId`                           | `_eq`, `_in`                      | Identifier of the profile in the client's own system — their ATS, their CRM, or whatever calls the public API. Never a Jarvi identifier. Unique per group, and used to recognise a profile that is sent again.                           |
| `publicIdentifier`                     | `_eq`, `_in`                      | LinkedIn public slug, the part after linkedin.com/in/. Unique per group. The person can change it on LinkedIn, which makes it the least reliable of the LinkedIn identifiers.                                                            |
| `linkedinId`                           | `_eq`, `_in`                      | Numeric LinkedIn identifier of the person. Unique per group. Not to be confused with memberId (member\_id), which holds the obfuscated "ACoAA…" identifier, nor with publicIdentifier (public\_identifier), which holds the URL slug.    |
| `primaryLocale`                        | `_eq`, `_in`, `_is_null`          | Main language of the profile itself — the language its LinkedIn page or CV is written in. Different from the profiles\_locales table, which lists the languages the person speaks and how well.                                          |
| `auditLogs.createdAt`                  | `_eq`, `_gte`, `_lte`, `_is_null` | When the tracked change happened. This is the reference date for incremental synchronisation: fetching everything modified since a given date goes through this column.                                                                  |

### Companies

| Filter                 | Operators                         | What it matches                                                                                                                                                         |
| ---------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `companySearch`        | `_search`                         | Searches company name and description, LinkedIn tagline and description, legal activity and NAF code, and custom fields — the target for keyword or industry searches.  |
| `companyQuickSearch`   | `_search`                         | Searches company name, email and phone — for name lookups only.                                                                                                         |
| `companies.global`     | `_search`                         | Company name and description.                                                                                                                                           |
| `location`             | `_near`                           | Geographic search. Use range 0 for an exact city or region match, or a radius in meters.                                                                                |
| `customField`          | `_search`                         | Value of a custom field. Target one field by suffixing its id, as in "customField.\<fieldId>".                                                                          |
| `hasLinkedinCompanyId` | `true`, `false`                   | The company is matched to a LinkedIn company page.                                                                                                                      |
| `hasContacts`          | `true`, `false`                   | The company has at least one profile associated as a contact.                                                                                                           |
| `hasProject`           | `true`, `false`                   | The company has at least one project.                                                                                                                                   |
| `isParentCompany`      | `true`, `false`                   | The company has at least one subsidiary.                                                                                                                                |
| `isSubsidiary`         | `true`, `false`                   | The company has a parent company.                                                                                                                                       |
| `isProtected`          | `true`, `false`                   | The company is under protection, meaning its protection date is still in the future.                                                                                    |
| `statusId`             | `_eq`, `_in`, `_is_null`          | Status of the company. A parent status also matches companies carrying any of its children.                                                                             |
| `filledCustomFields`   | `_all`, `_in`                     | Custom field UUIDs. \_all requires every field, \_in requires any of them.                                                                                              |
| `emptyCustomFields`    | `_all`, `_in`                     | Custom field UUIDs. \_all requires every field, \_in requires any of them.                                                                                              |
| `id`                   | `_eq`, `_in`, `_is_null`          | Jarvi identifier of the company, used in the public API and in app URLs.                                                                                                |
| `createdAt`            | `_eq`, `_gte`, `_lte`, `_is_null` | Date the company record was created. Data imports replace it with the creation date coming from the source ATS or CRM.                                                  |
| `externalId`           | `_eq`, `_in`                      | Identifier of the company in the client's own system. Unique per group, and used as the matching key by imports and by the public API.                                  |
| `linkedinCompanyId`    | `_eq`, `_in`                      | Link to the LinkedIn page data of this company. That data is shared across all groups, and a given LinkedIn page can be attached to at most one company per group.      |
| `parentId`             | `_eq`, `_in`, `_is_null`          | Parent company when this record is a subsidiary. Used as a single level: searching on a parent can include its direct subsidiaries, but not their own.                  |
| `auditLogs.createdAt`  | `_eq`, `_gte`, `_lte`, `_is_null` | When the tracked change happened. This is the reference date for incremental synchronisation: fetching everything modified since a given date goes through this column. |

### Projects

| Filter                | Operators                         | What it matches                                                                                                                                                         |
| --------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `projectNameSearch`   | `_search`                         | Searches project name, its company name and its reference id — the target for project lookups.                                                                          |
| `customField`         | `_search`                         | Value of a custom field. Target one field by suffixing its id, as in "customField.\<fieldId>".                                                                          |
| `hasJobBoardEnabled`  | `true`, `false`                   | The project is published on at least one job board.                                                                                                                     |
| `hasLinkedinId`       | `true`, `false`                   | The project is matched to a LinkedIn job posting.                                                                                                                       |
| `filledCustomFields`  | `_all`, `_in`                     | Custom field UUIDs. \_all requires every field, \_in requires any of them.                                                                                              |
| `emptyCustomFields`   | `_all`, `_in`                     | Custom field UUIDs. \_all requires every field, \_in requires any of them.                                                                                              |
| `statusId`            | `_eq`, `_in`, `_is_null`          | Status of the project. A parent status also matches projects carrying any of its children.                                                                              |
| `id`                  | `_eq`, `_in`, `_is_null`          | Jarvi identifier of the project, used in the public API and in app URLs.                                                                                                |
| `createdAt`           | `_eq`, `_gte`, `_lte`, `_is_null` | Date the project was created. Data imports replace it with the creation date coming from the source ATS or CRM.                                                         |
| `externalId`          | `_eq`, `_in`                      | Identifier of the project in the client's own system. Unique per group, and used as the matching key by imports and by the public API.                                  |
| `referenceId`         | `_eq`, `_in`                      | The project reference id is used to map external job applications on website or jobboard to the project.                                                                |
| `companyId`           | `_eq`, `_in`, `_is_null`          | Client company the project is for. Optional — a project can exist without a company, and deleting the company clears the link rather than the project.                  |
| `auditLogs.createdAt` | `_eq`, `_gte`, `_lte`, `_is_null` | When the tracked change happened. This is the reference date for incremental synchronisation: fetching everything modified since a given date goes through this column. |

<Info>
  Questi elenchi sono generati dal motore di ricerca stesso, quindi corrispondono sempre a ciò che
  l'API accetta. Le stesse definizioni sono servite come JSON Schema da [GET
  /openapi](https://functions.prod.jarvi.tech/v1/public-api/openapi), sotto `ProfilesFilters`,
  `CompaniesFilters` e `ProjectsFilters`.
</Info>

## Ordinare

Il parametro `orderBy` di ogni endpoint REST associa un campo e una direzione:

```
?orderBy={"addedAt":"desc"}
```

I campi accettati da una risorsa sono elencati nella documentazione del parametro stesso, sulla pagina dell'endpoint. Ordinare su qualcos'altro ricade sull'ordine predefinito invece di fallire.

## Cercare tramite GraphQL

La query `search` restituisce identificatori e un totale, che carichi poi con una seconda chiamata. Questa divisione in due tempi è ciò che mantiene veloce una ricerca, qualunque sia la dimensione delle schede:

```graphql theme={null}
query FindDevelopers {
  search(
    resource: "profiles"
    filters: { globalSearch: { _search: "javascript AND react" }, isTalent: true }
    sort: { field: "addedAt", order: "DESC" }
    limit: 50
  ) {
    ids
    total
  }
}
```

```graphql theme={null}
query LoadThem($ids: [uuid!]!) {
  profiles(where: { id: { _in: $ids } }) {
    id
    firstName
    lastName
  }
}
```

`resource` vale `profiles`, `companies` o `projects`. `filters` prende lo stesso oggetto del parametro `where` del REST.

## Lasciare `_ilike`

| Invece di                                                 | Scrivi                                        |
| --------------------------------------------------------- | --------------------------------------------- |
| `{"lastName": {"_ilike": "%Dupont%"}}`                    | `{"quickSearch": {"_search": "Dupont"}}`      |
| `{"emailAddresses": {"email": {"_ilike": "%@acme.com"}}}` | `{"emails": {"_search": "acme.com"}}`         |
| `{"headline": {"_ilike": "%developer%"}}`                 | `{"globalSearch": {"_search": "developer"}}`  |
| `{"name": {"_ilike": "%Acme%"}}` (aziende)                | `{"companyQuickSearch": {"_search": "Acme"}}` |
| `{"externalId": {"_ilike": "ABC-123"}}`                   | `{"externalId": {"_eq": "ABC-123"}}`          |

Un identificatore o una URL non è mai una ricerca: usa `_eq`, che passa dal proprio indice.

<Note>
  Ti manca qualcosa, o non trovi un filtro che ti aspettavi? Scrivici — l'elenco qui sopra è guidato
  dal motore, aggiungerci un filtro è una modifica piccola.
</Note>
