Natural-language search over meeting/legislation document embeddings. Embeds
the user's query via the internal Octen 8B service and runs a kNN search
against the document embedding index. Hits are grouped by document and
returned in best-score (relevance) order with a server-side similarity floor.
curl -X GET \
-H "x-api-key: [[apiKey]]" \
-H "Accept: application/json" \
"https://dataapi.cloverleaf.ai/search/meeting-documents/nls?nls-query=nlsQuery_example&filter-params=filterParams_example&index-name=indexName_example&date-range=&page=3.4&per-page=3.4&k=3.4&meeting-document-ids=&use-territory=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Create an instance of the API class
DefaultApi apiInstance = new DefaultApi();
String nlsQuery = nlsQuery_example; // String | The natural-language query to embed and search.
String filterParams = filterParams_example; // String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources".
String indexName = indexName_example; // String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both.
array[Float] dateRange = ; // array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970.
Float page = 3.4; // Float | Which page of document hits to return.
Float perPage = 3.4; // Float | Number of document hits per page.
Float k = 3.4; // Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side.
array[Float] meetingDocumentIds = ; // array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping.
Boolean useTerritory = true; // Boolean | When true, scope the search to the authenticated user's territory channels.
try {
DocumentNlsSearchResult result = apiInstance.searchMeetingDocumentsNls(nlsQuery, filterParams, indexName, dateRange, page, perPage, k, meetingDocumentIds, useTerritory);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#searchMeetingDocumentsNls");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String nlsQuery = new String(); // String | The natural-language query to embed and search.
final String filterParams = new String(); // String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources".
final String indexName = new String(); // String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both.
final array[Float] dateRange = new array[Float](); // array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970.
final Float page = new Float(); // Float | Which page of document hits to return.
final Float perPage = new Float(); // Float | Number of document hits per page.
final Float k = new Float(); // Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side.
final array[Float] meetingDocumentIds = new array[Float](); // array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping.
final Boolean useTerritory = new Boolean(); // Boolean | When true, scope the search to the authenticated user's territory channels.
try {
final result = await api_instance.searchMeetingDocumentsNls(nlsQuery, filterParams, indexName, dateRange, page, perPage, k, meetingDocumentIds, useTerritory);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->searchMeetingDocumentsNls: $e\n');
}
import org.openapitools.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String nlsQuery = nlsQuery_example; // String | The natural-language query to embed and search.
String filterParams = filterParams_example; // String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources".
String indexName = indexName_example; // String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both.
array[Float] dateRange = ; // array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970.
Float page = 3.4; // Float | Which page of document hits to return.
Float perPage = 3.4; // Float | Number of document hits per page.
Float k = 3.4; // Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side.
array[Float] meetingDocumentIds = ; // array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping.
Boolean useTerritory = true; // Boolean | When true, scope the search to the authenticated user's territory channels.
try {
DocumentNlsSearchResult result = apiInstance.searchMeetingDocumentsNls(nlsQuery, filterParams, indexName, dateRange, page, perPage, k, meetingDocumentIds, useTerritory);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#searchMeetingDocumentsNls");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"x-api-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"x-api-key"];
// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *nlsQuery = nlsQuery_example; // The natural-language query to embed and search. (default to null)
String *filterParams = filterParams_example; // Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources". (default to null)
String *indexName = indexName_example; // Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both. (optional) (default to null)
array[Float] *dateRange = ; // An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970. (optional) (default to null)
Float *page = 3.4; // Which page of document hits to return. (optional) (default to null)
Float *perPage = 3.4; // Number of document hits per page. (optional) (default to null)
Float *k = 3.4; // Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side. (optional) (default to null)
array[Float] *meetingDocumentIds = ; // Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping. (optional) (default to null)
Boolean *useTerritory = true; // When true, scope the search to the authenticated user's territory channels. (optional) (default to null)
[apiInstance searchMeetingDocumentsNlsWith:nlsQuery
filterParams:filterParams
indexName:indexName
dateRange:dateRange
page:page
perPage:perPage
k:k
meetingDocumentIds:meetingDocumentIds
useTerritory:useTerritory
completionHandler: ^(DocumentNlsSearchResult output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CloverleafSearchApi = require('cloverleaf_search_api');
var defaultClient = CloverleafSearchApi.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['x-api-key'] = "Token";
// Create an instance of the API class
var api = new CloverleafSearchApi.DefaultApi()
var nlsQuery = nlsQuery_example; // {String} The natural-language query to embed and search.
var filterParams = filterParams_example; // {String} Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources".
var opts = {
'indexName': indexName_example, // {String} Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both.
'dateRange': , // {array[Float]} An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970.
'page': 3.4, // {Float} Which page of document hits to return.
'perPage': 3.4, // {Float} Number of document hits per page.
'k': 3.4, // {Float} Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side.
'meetingDocumentIds': , // {array[Float]} Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping.
'useTerritory': true // {Boolean} When true, scope the search to the authenticated user's territory channels.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.searchMeetingDocumentsNls(nlsQuery, filterParams, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class searchMeetingDocumentsNlsExample
{
public void main()
{
// Configure API key authorization: api_key
Configuration.Default.ApiKey.Add("x-api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("x-api-key", "Bearer");
// Create an instance of the API class
var apiInstance = new DefaultApi();
var nlsQuery = nlsQuery_example; // String | The natural-language query to embed and search. (default to null)
var filterParams = filterParams_example; // String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources". (default to null)
var indexName = indexName_example; // String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both. (optional) (default to null)
var dateRange = new array[Float](); // array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970. (optional) (default to null)
var page = 3.4; // Float | Which page of document hits to return. (optional) (default to null)
var perPage = 3.4; // Float | Number of document hits per page. (optional) (default to null)
var k = 3.4; // Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side. (optional) (default to null)
var meetingDocumentIds = new array[Float](); // array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping. (optional) (default to null)
var useTerritory = true; // Boolean | When true, scope the search to the authenticated user's territory channels. (optional) (default to null)
try {
DocumentNlsSearchResult result = apiInstance.searchMeetingDocumentsNls(nlsQuery, filterParams, indexName, dateRange, page, perPage, k, meetingDocumentIds, useTerritory);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling DefaultApi.searchMeetingDocumentsNls: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$nlsQuery = nlsQuery_example; // String | The natural-language query to embed and search.
$filterParams = filterParams_example; // String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources".
$indexName = indexName_example; // String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both.
$dateRange = ; // array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970.
$page = 3.4; // Float | Which page of document hits to return.
$perPage = 3.4; // Float | Number of document hits per page.
$k = 3.4; // Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side.
$meetingDocumentIds = ; // array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping.
$useTerritory = true; // Boolean | When true, scope the search to the authenticated user's territory channels.
try {
$result = $api_instance->searchMeetingDocumentsNls($nlsQuery, $filterParams, $indexName, $dateRange, $page, $perPage, $k, $meetingDocumentIds, $useTerritory);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->searchMeetingDocumentsNls: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;
# Configure API key authorization: api_key
$WWW::OPenAPIClient::Configuration::api_key->{'x-api-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'x-api-key'} = "Bearer";
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $nlsQuery = nlsQuery_example; # String | The natural-language query to embed and search.
my $filterParams = filterParams_example; # String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources".
my $indexName = indexName_example; # String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both.
my $dateRange = []; # array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970.
my $page = 3.4; # Float | Which page of document hits to return.
my $perPage = 3.4; # Float | Number of document hits per page.
my $k = 3.4; # Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side.
my $meetingDocumentIds = []; # array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping.
my $useTerritory = true; # Boolean | When true, scope the search to the authenticated user's territory channels.
eval {
my $result = $api_instance->searchMeetingDocumentsNls(nlsQuery => $nlsQuery, filterParams => $filterParams, indexName => $indexName, dateRange => $dateRange, page => $page, perPage => $perPage, k => $k, meetingDocumentIds => $meetingDocumentIds, useTerritory => $useTerritory);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->searchMeetingDocumentsNls: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
openapi_client.configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
nlsQuery = nlsQuery_example # String | The natural-language query to embed and search. (default to null)
filterParams = filterParams_example # String | Base64 encoded object containing filter parameters. The original
object may have keys "states", "counties", "cities", "channel_types",
"organizations", "legislative_bodies", "document_types", and "sources". (default to null)
indexName = indexName_example # String | Scopes results by document_type, mirroring keyword search:
"legislation-documents" (legislative types), "meeting-documents"
(agenda/minutes/etc.), or omitted to search both. (optional) (default to null)
dateRange = # array[Float] | An array of 2 integers indicating the start and end of the search,
in milliseconds since January 1st 1970. (optional) (default to null)
page = 3.4 # Float | Which page of document hits to return. (optional) (default to null)
perPage = 3.4 # Float | Number of document hits per page. (optional) (default to null)
k = 3.4 # Float | Number of nearest-neighbor chunk hits to retrieve from Elasticsearch
before grouping by document and paginating. Capped server-side. (optional) (default to null)
meetingDocumentIds = # array[Float] | Optional explicit document-id scope. When provided, restricts NLS
results to these meeting_document_ids before grouping. (optional) (default to null)
useTerritory = true # Boolean | When true, scope the search to the authenticated user's territory channels. (optional) (default to null)
try:
api_response = api_instance.search_meeting_documents_nls(nlsQuery, filterParams, indexName=indexName, dateRange=dateRange, page=page, perPage=perPage, k=k, meetingDocumentIds=meetingDocumentIds, useTerritory=useTerritory)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->searchMeetingDocumentsNls: %s\n" % e)
extern crate DefaultApi;
pub fn main() {
let nlsQuery = nlsQuery_example; // String
let filterParams = filterParams_example; // String
let indexName = indexName_example; // String
let dateRange = ; // array[Float]
let page = 3.4; // Float
let perPage = 3.4; // Float
let k = 3.4; // Float
let meetingDocumentIds = ; // array[Float]
let useTerritory = true; // Boolean
let mut context = DefaultApi::Context::default();
let result = client.searchMeetingDocumentsNls(nlsQuery, filterParams, indexName, dateRange, page, perPage, k, meetingDocumentIds, useTerritory, &context).wait();
println!("{:?}", result);
}