Skip to content

Commit

Permalink
Merge branch 'main' into kderusso/semantic-text-knn-query
Browse files Browse the repository at this point in the history
  • Loading branch information
kderusso authored Dec 19, 2024
2 parents ef06879 + 97a3540 commit dea977d
Show file tree
Hide file tree
Showing 307 changed files with 6,240 additions and 1,518 deletions.
101 changes: 2 additions & 99 deletions .ci/init.gradle
Original file line number Diff line number Diff line change
@@ -1,95 +1,3 @@
import com.bettercloud.vault.VaultConfig
import com.bettercloud.vault.Vault

initscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.bettercloud:vault-java-driver:4.1.0'
}
}

boolean USE_ARTIFACTORY = false

if (System.getenv('VAULT_ADDR') == null) {
// When trying to reproduce errors outside of CI, it can be useful to allow this to just return rather than blowing up
if (System.getenv('CI') == null) {
return
}

throw new GradleException("You must set the VAULT_ADDR environment variable to use this init script.")
}

if (System.getenv('VAULT_ROLE_ID') == null && System.getenv('VAULT_SECRET_ID') == null && System.getenv('VAULT_TOKEN') == null) {
// When trying to reproduce errors outside of CI, it can be useful to allow this to just return rather than blowing up
if (System.getenv('CI') == null) {
return
}

throw new GradleException("You must set either the VAULT_ROLE_ID and VAULT_SECRET_ID environment variables, " +
"or the VAULT_TOKEN environment variable to use this init script.")
}

final String vaultPathPrefix = System.getenv('VAULT_ADDR') ==~ /.+vault-ci.+\.dev.*/ ? "secret/ci/elastic-elasticsearch/migrated" : "secret/elasticsearch-ci"

final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
new VaultConfig()
.address(System.env.VAULT_ADDR)
.engineVersion(1)
.build()
)
.withRetries(5, 1000)
.auth()
.loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID)
.getAuthClientToken()

final Vault vault = new Vault(
new VaultConfig()
.address(System.env.VAULT_ADDR)
.engineVersion(1)
.token(vaultToken)
.build()
)
.withRetries(5, 1000)


if (USE_ARTIFACTORY) {
final Map<String, String> artifactoryCredentials = vault.logical()
.read("${vaultPathPrefix}/artifactory.elstc.co")
.getData()
logger.info("Using elastic artifactory repos")
Closure configCache = {
return {
name "artifactory-gradle-release"
url "https://artifactory.elstc.co/artifactory/gradle-release"
credentials {
username artifactoryCredentials.get("username")
password artifactoryCredentials.get("token")
}
}
}
settingsEvaluated { settings ->
settings.pluginManagement {
repositories {
maven configCache()
}
}
}
projectsLoaded {
allprojects {
buildscript {
repositories {
maven configCache()
}
}
repositories {
maven configCache()
}
}
}
}

gradle.settingsEvaluated { settings ->
settings.pluginManager.withPlugin("com.gradle.develocity") {
settings.develocity {
Expand All @@ -98,14 +6,10 @@ gradle.settingsEvaluated { settings ->
}
}


final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))

if (buildCacheUrl) {
final Map<String, String> buildCacheCredentials = System.getenv("GRADLE_BUILD_CACHE_USERNAME") ? [:] : vault.logical()
.read("${vaultPathPrefix}/gradle-build-cache")
.getData()
gradle.settingsEvaluated { settings ->
settings.buildCache {
local {
Expand All @@ -116,11 +20,10 @@ if (buildCacheUrl) {
url = buildCacheUrl
push = buildCachePush
credentials {
username = System.getenv("GRADLE_BUILD_CACHE_USERNAME") ?: buildCacheCredentials.get("username")
password = System.getenv("GRADLE_BUILD_CACHE_PASSWORD") ?: buildCacheCredentials.get("password")
username = System.getenv("GRADLE_BUILD_CACHE_USERNAME")
password = System.getenv("GRADLE_BUILD_CACHE_PASSWORD")
}
}
}
}
}

5 changes: 5 additions & 0 deletions docs/changelog/116687.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 116687
summary: Add LogsDB option to route on sort fields
area: Logs
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/118353.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118353
summary: Epoch Millis Rounding Down and Not Up 2
area: Infra/Core
type: bug
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/118562.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 118562
summary: Update data stream deprecations warnings to new format and filter searchable
snapshots from response
area: Data streams
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/118603.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 118603
summary: Allow DATE_PARSE to read the timezones
area: ES|QL
type: bug
issues:
- 117680
5 changes: 5 additions & 0 deletions docs/changelog/118823.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118823
summary: Fix attribute set equals
area: ES|QL
type: bug
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/118931.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 118931
summary: Add a `LicenseAware` interface for licensed Nodes
area: ES|QL
type: enhancement
issues:
- 117405
5 changes: 5 additions & 0 deletions docs/changelog/118941.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118941
summary: Allow archive and searchable snapshots indices in N-2 version
area: Recovery
type: enhancement
issues: []
105 changes: 105 additions & 0 deletions docs/reference/connector/docs/connectors-sharepoint-online.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,58 @@ The application name will appear in the Title box.
</AppPermissionRequests>
----
[discrete#es-connectors-sharepoint-online-sites-selected-permissions]
====== Granting `Sites.Selected` permissions
To configure `Sites.Selected` permissions, follow these steps in the Azure Active Directory portal. These permissions enable precise access control to specific SharePoint sites.
. Sign in to the https://portal.azure.com/[Azure Active Directory portal^].
. Navigate to **App registrations** and locate the application created for the connector.
. Under **API permissions**, click **Add permission**.
. Select **Microsoft Graph** > **Application permissions**, then add `Sites.Selected`.
. Click **Grant admin consent** to approve the permission.
[TIP]
====
Refer to the official https://learn.microsoft.com/en-us/graph/permissions-reference[Microsoft documentation] for managing permissions in Azure AD.
====
To assign access to specific SharePoint sites using `Sites.Selected`:
. Use Microsoft Graph Explorer or PowerShell to grant access.
. To fetch the site ID, run the following Graph API query:
+
[source, http]
----
GET https://graph.microsoft.com/v1.0/sites?select=webUrl,Title,Id&$search="<Name of the site>*"
----
+
This will return the `id` of the site.
. Use the `id` to assign read or write access:
+
[source, http]
----
POST https://graph.microsoft.com/v1.0/sites/<siteId>/permissions
{
"roles": ["read"], // or "write"
"grantedToIdentities": [
{
"application": {
"id": "<App_Client_ID>",
"displayName": "<App_Display_Name>"
}
}
]
}
----
[NOTE]
====
When using the `Comma-separated list of sites` configuration field, ensure the sites specified match those granted `Sites.Selected` permission in SharePoint.
If the `Comma-separated list of sites` field is set to `*` or the `Enumerate all sites` toggle is enabled, the connector will attempt to access all sites. This requires broader permissions, which are not supported with `Sites.Selected`.
====
.Graph API permissions
****
Microsoft recommends using Graph API for all operations with Sharepoint Online. Graph API is well-documented and more efficient at fetching data, which helps avoid throttling.
Expand Down Expand Up @@ -594,6 +646,59 @@ The application name will appear in the Title box.
</AppPermissionRequests>
----
[discrete#es-connectors-sharepoint-online-sites-selected-permissions-self-managed]
====== Granting `Sites.Selected` permissions
To configure `Sites.Selected` permissions, follow these steps in the Azure Active Directory portal. These permissions enable precise access control to specific SharePoint sites.
. Sign in to the https://portal.azure.com/[Azure Active Directory portal^].
. Navigate to **App registrations** and locate the application created for the connector.
. Under **API permissions**, click **Add permission**.
. Select **Microsoft Graph** > **Application permissions**, then add `Sites.Selected`.
. Click **Grant admin consent** to approve the permission.
[TIP]
====
Refer to the official https://learn.microsoft.com/en-us/graph/permissions-reference[Microsoft documentation] for managing permissions in Azure AD.
====
To assign access to specific SharePoint sites using `Sites.Selected`:
. Use Microsoft Graph Explorer or PowerShell to grant access.
. To fetch the site ID, run the following Graph API query:
+
[source, http]
----
GET https://graph.microsoft.com/v1.0/sites?select=webUrl,Title,Id&$search="<Name of the site>*"
----
+
This will return the `id` of the site.
. Use the `id` to assign read or write access:
+
[source, http]
----
POST https://graph.microsoft.com/v1.0/sites/<siteId>/permissions
{
"roles": ["read"], // or "write"
"grantedToIdentities": [
{
"application": {
"id": "<App_Client_ID>",
"displayName": "<App_Display_Name>"
}
}
]
}
----
[NOTE]
====
When using the `Comma-separated list of sites` configuration field, ensure the sites specified match those granted `Sites.Selected` permission in SharePoint.
If the `Comma-separated list of sites` field is set to `*` or the `Enumerate all sites` toggle is enabled, the connector will attempt to access all sites. This requires broader permissions, which are not supported with `Sites.Selected`.
====
.Graph API permissions
****
Microsoft recommends using Graph API for all operations with Sharepoint Online. Graph API is well-documented and more efficient at fetching data, which helps avoid throttling.
Expand Down
11 changes: 10 additions & 1 deletion docs/reference/esql/esql-limitations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ it is necessary to use the search function, like <<esql-match>>, in a <<esql-whe
directly after the <<esql-from>> source command, or close enough to it.
Otherwise, the query will fail with a validation error.
Another limitation is that any <<esql-where>> command containing a full-text search function
cannot also use disjunctions (`OR`).
cannot also use disjunctions (`OR`) unless all functions used in the OR clauses are full-text functions themselves.

For example, this query is valid:

Expand All @@ -139,6 +139,15 @@ FROM books
| WHERE MATCH(author, "Faulkner") OR author LIKE "Hemingway"
----

However this query will succeed because it uses full text functions on both `OR` clauses:

[source,esql]
----
FROM books
| WHERE MATCH(author, "Faulkner") OR QSTR("author: Hemingway")
----


Note that, because of <<esql-limitations-text-fields,the way {esql} treats `text` values>>,
any queries on `text` fields that do not explicitly use the full-text functions,
<<esql-match>> or <<esql-qstr>>, will behave as if the fields are actually `keyword` fields:
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/description/match.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/esql/functions/kibana/definition/match.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion docs/reference/esql/functions/kibana/docs/match.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion docs/reference/esql/functions/search-functions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
++++

Full text functions are used to search for text in fields.
<<analysis, Text analysiss>> is used to analyze the query before it is searched.
<<analysis, Text analysis>> is used to analyze the query before it is searched.

Full text functions can be used to match <<esql-multivalued-fields,multivalued fields>>.
A multivalued field that contains a value that matches a full text query is considered to match the query.

Full text functions are significantly more performant for text search use cases on large data sets than using pattern matching or regular expressions with `LIKE` or `RLIKE`

See <<esql-limitations-full-text-search,full text search limitations>> for information on the limitations of full text search.

{esql} supports these full-text search functions:
Expand Down
22 changes: 21 additions & 1 deletion docs/reference/esql/processing-commands/where.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ the input table for which the provided condition evaluates to `true`.

[TIP]
====
In case of value exclusions, fields with `null` values will be excluded from search results.
In case of value exclusions, fields with `null` values will be excluded from search results.
In this context a `null` means either there is an explicit `null` value in the document or there is no value at all.
For example: `WHERE field != "value"` will be interpreted as `WHERE field != "value" AND field IS NOT NULL`.
====
Expand Down Expand Up @@ -58,6 +58,26 @@ For a complete list of all functions, refer to <<esql-functions>>.

include::../functions/predicates.asciidoc[tag=body]

For matching text, you can use <<esql-search-functions,full text search functions>> like `MATCH`.

Use <<esql-match,`MATCH`>> to perform a <<query-dsl-match-query,match query>> on a specified field.

Match can be used on text fields, as well as other field types like boolean, dates, and numeric types.

[source.merge.styled,esql]
----
include::{esql-specs}/match-function.csv-spec[tag=match-with-field]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/match-function.csv-spec[tag=match-with-field-result]
|===

[TIP]
====
You can also use the shorthand <<esql-search-operators,match operator>> `:` instead of `MATCH`.
====

include::../functions/like.asciidoc[tag=body]

include::../functions/rlike.asciidoc[tag=body]
Expand Down
Loading

0 comments on commit dea977d

Please sign in to comment.