From 5103e23599148c7b8a1d251fc184bfccddc384d6 Mon Sep 17 00:00:00 2001 From: jzonthemtn Date: Wed, 29 May 2024 12:10:56 -0400 Subject: [PATCH] Changing query mapping. Updating readme and version number. --- README.md | 6 +++++- gradle.properties | 2 +- src/main/resources/queries-mapping.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1a01ad4..b062415 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ The `ubi` block can contain the following parameters. All parameters are optiona * `user_query` - The user-entered query. This is meant to be the actual text the user provided to initiate the search. * `client_id` - A unique identifier for the originator of the query. The client may be a user, an application, or any other originator of the query. The `client_id` can be in any format but we use UUIDs in the examples. * `object_id_field` - The name of a field in the index that contains a unique identifier for each result. If not provided, the `_id` field is used. +* `query_attributes` - A map of arbitrary key/value pairs that will be indexed along with the query. This can be used to capture additional information about the query, such as an experiment ID or other details. Following is an example query that provides the parameters: @@ -99,7 +100,10 @@ curl -s http://localhost:9200/your-index/_search -H "Content-Type: application/j "query_id": "12300d16cb-b6f1-4012-93ebcc49cac90426", "user_query": "Toner", "client_id": "c4af7ca2-d6d2-4326-a41f-e616ebdd3d7b", - "object_id_field": "product_name" + "object_id_field": "product_name", + "query_attributes": { + "experiment_id": "12345" + } } }, "query": { diff --git a/gradle.properties b/gradle.properties index bd1db54..2f5af7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ opensearchVersion = 2.14.0 -ubiVersion = 0.0.11 +ubiVersion = 0.0.12 diff --git a/src/main/resources/queries-mapping.json b/src/main/resources/queries-mapping.json index 4b8c41a..fb2b179 100644 --- a/src/main/resources/queries-mapping.json +++ b/src/main/resources/queries-mapping.json @@ -3,7 +3,7 @@ "properties": { "timestamp": { "type": "date" }, "query_id": { "type": "keyword", "ignore_above": 100 }, - "query": { "type": "flat_object" }, + "query": { "type": "text" }, "query_response_id": { "type": "keyword", "ignore_above": 100 }, "query_response_hit_ids": { "type": "keyword" }, "user_query": { "type": "text",