The `results` map preserves the order of the `sort` parameter (Lucene scoring order for `relevancy`).
curl -X GET \
-H "Accept: application/json" \
"/api/v1/search?full=full_example&def=def_example&symbol=symbol_example&path=path_example&hist=hist_example&type=type_example&projects=projects_example&maxresults=56&start=56&maxhitsperfile=56&sort=sort_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.SearchApi;
import java.io.File;
import java.util.*;
public class SearchApiExample {
public static void main(String[] args) {
// Create an instance of the API class
SearchApi apiInstance = new SearchApi();
String full = full_example; // String | Full search field value to search for.
String def = def_example; // String | Definition field value to search for.
String symbol = symbol_example; // String | Symbol field value to search for.
String path = path_example; // String | File path field value to search for.
String hist = hist_example; // String | History field value to search for.
String type = type_example; // String | Type of files to search for.
String projects = projects_example; // String | Projects to search in.
Integer maxresults = 56; // Integer | Maximum number of documents whose hits will be returned.
Integer start = 56; // Integer | Start index from which to return results.
Integer maxhitsperfile = 56; // Integer | Maximum number of matching lines returned per file. `0` returns all matching lines.
String sort = sort_example; // String | Sort order for results.
try {
SearchResponse result = apiInstance.search(full, def, symbol, path, hist, type, projects, maxresults, start, maxhitsperfile, sort);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SearchApi#search");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String full = new String(); // String | Full search field value to search for.
final String def = new String(); // String | Definition field value to search for.
final String symbol = new String(); // String | Symbol field value to search for.
final String path = new String(); // String | File path field value to search for.
final String hist = new String(); // String | History field value to search for.
final String type = new String(); // String | Type of files to search for.
final String projects = new String(); // String | Projects to search in.
final Integer maxresults = new Integer(); // Integer | Maximum number of documents whose hits will be returned.
final Integer start = new Integer(); // Integer | Start index from which to return results.
final Integer maxhitsperfile = new Integer(); // Integer | Maximum number of matching lines returned per file. `0` returns all matching lines.
final String sort = new String(); // String | Sort order for results.
try {
final result = await api_instance.search(full, def, symbol, path, hist, type, projects, maxresults, start, maxhitsperfile, sort);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->search: $e\n');
}
import org.openapitools.client.api.SearchApi;
public class SearchApiExample {
public static void main(String[] args) {
SearchApi apiInstance = new SearchApi();
String full = full_example; // String | Full search field value to search for.
String def = def_example; // String | Definition field value to search for.
String symbol = symbol_example; // String | Symbol field value to search for.
String path = path_example; // String | File path field value to search for.
String hist = hist_example; // String | History field value to search for.
String type = type_example; // String | Type of files to search for.
String projects = projects_example; // String | Projects to search in.
Integer maxresults = 56; // Integer | Maximum number of documents whose hits will be returned.
Integer start = 56; // Integer | Start index from which to return results.
Integer maxhitsperfile = 56; // Integer | Maximum number of matching lines returned per file. `0` returns all matching lines.
String sort = sort_example; // String | Sort order for results.
try {
SearchResponse result = apiInstance.search(full, def, symbol, path, hist, type, projects, maxresults, start, maxhitsperfile, sort);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SearchApi#search");
e.printStackTrace();
}
}
}
// Create an instance of the API class
SearchApi *apiInstance = [[SearchApi alloc] init];
String *full = full_example; // Full search field value to search for. (optional) (default to null)
String *def = def_example; // Definition field value to search for. (optional) (default to null)
String *symbol = symbol_example; // Symbol field value to search for. (optional) (default to null)
String *path = path_example; // File path field value to search for. (optional) (default to null)
String *hist = hist_example; // History field value to search for. (optional) (default to null)
String *type = type_example; // Type of files to search for. (optional) (default to null)
String *projects = projects_example; // Projects to search in. (optional) (default to null)
Integer *maxresults = 56; // Maximum number of documents whose hits will be returned. (optional) (default to 1000)
Integer *start = 56; // Start index from which to return results. (optional) (default to null)
Integer *maxhitsperfile = 56; // Maximum number of matching lines returned per file. `0` returns all matching lines. (optional) (default to 0)
String *sort = sort_example; // Sort order for results. (optional) (default to relevancy)
// Return search results
[apiInstance searchWith:full
def:def
symbol:symbol
path:path
hist:hist
type:type
projects:projects
maxresults:maxresults
start:start
maxhitsperfile:maxhitsperfile
sort:sort
completionHandler: ^(SearchResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OpenGrokResTfulApi = require('open_grok_res_tful_api');
// Create an instance of the API class
var api = new OpenGrokResTfulApi.SearchApi()
var opts = {
'full': full_example, // {String} Full search field value to search for.
'def': def_example, // {String} Definition field value to search for.
'symbol': symbol_example, // {String} Symbol field value to search for.
'path': path_example, // {String} File path field value to search for.
'hist': hist_example, // {String} History field value to search for.
'type': type_example, // {String} Type of files to search for.
'projects': projects_example, // {String} Projects to search in.
'maxresults': 56, // {Integer} Maximum number of documents whose hits will be returned.
'start': 56, // {Integer} Start index from which to return results.
'maxhitsperfile': 56, // {Integer} Maximum number of matching lines returned per file. `0` returns all matching lines.
'sort': sort_example // {String} Sort order for results.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.search(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class searchExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new SearchApi();
var full = full_example; // String | Full search field value to search for. (optional) (default to null)
var def = def_example; // String | Definition field value to search for. (optional) (default to null)
var symbol = symbol_example; // String | Symbol field value to search for. (optional) (default to null)
var path = path_example; // String | File path field value to search for. (optional) (default to null)
var hist = hist_example; // String | History field value to search for. (optional) (default to null)
var type = type_example; // String | Type of files to search for. (optional) (default to null)
var projects = projects_example; // String | Projects to search in. (optional) (default to null)
var maxresults = 56; // Integer | Maximum number of documents whose hits will be returned. (optional) (default to 1000)
var start = 56; // Integer | Start index from which to return results. (optional) (default to null)
var maxhitsperfile = 56; // Integer | Maximum number of matching lines returned per file. `0` returns all matching lines. (optional) (default to 0)
var sort = sort_example; // String | Sort order for results. (optional) (default to relevancy)
try {
// Return search results
SearchResponse result = apiInstance.search(full, def, symbol, path, hist, type, projects, maxresults, start, maxhitsperfile, sort);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling SearchApi.search: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\SearchApi();
$full = full_example; // String | Full search field value to search for.
$def = def_example; // String | Definition field value to search for.
$symbol = symbol_example; // String | Symbol field value to search for.
$path = path_example; // String | File path field value to search for.
$hist = hist_example; // String | History field value to search for.
$type = type_example; // String | Type of files to search for.
$projects = projects_example; // String | Projects to search in.
$maxresults = 56; // Integer | Maximum number of documents whose hits will be returned.
$start = 56; // Integer | Start index from which to return results.
$maxhitsperfile = 56; // Integer | Maximum number of matching lines returned per file. `0` returns all matching lines.
$sort = sort_example; // String | Sort order for results.
try {
$result = $api_instance->search($full, $def, $symbol, $path, $hist, $type, $projects, $maxresults, $start, $maxhitsperfile, $sort);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SearchApi->search: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::SearchApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::SearchApi->new();
my $full = full_example; # String | Full search field value to search for.
my $def = def_example; # String | Definition field value to search for.
my $symbol = symbol_example; # String | Symbol field value to search for.
my $path = path_example; # String | File path field value to search for.
my $hist = hist_example; # String | History field value to search for.
my $type = type_example; # String | Type of files to search for.
my $projects = projects_example; # String | Projects to search in.
my $maxresults = 56; # Integer | Maximum number of documents whose hits will be returned.
my $start = 56; # Integer | Start index from which to return results.
my $maxhitsperfile = 56; # Integer | Maximum number of matching lines returned per file. `0` returns all matching lines.
my $sort = sort_example; # String | Sort order for results.
eval {
my $result = $api_instance->search(full => $full, def => $def, symbol => $symbol, path => $path, hist => $hist, type => $type, projects => $projects, maxresults => $maxresults, start => $start, maxhitsperfile => $maxhitsperfile, sort => $sort);
print Dumper($result);
};
if ($@) {
warn "Exception when calling SearchApi->search: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.SearchApi()
full = full_example # String | Full search field value to search for. (optional) (default to null)
def = def_example # String | Definition field value to search for. (optional) (default to null)
symbol = symbol_example # String | Symbol field value to search for. (optional) (default to null)
path = path_example # String | File path field value to search for. (optional) (default to null)
hist = hist_example # String | History field value to search for. (optional) (default to null)
type = type_example # String | Type of files to search for. (optional) (default to null)
projects = projects_example # String | Projects to search in. (optional) (default to null)
maxresults = 56 # Integer | Maximum number of documents whose hits will be returned. (optional) (default to 1000)
start = 56 # Integer | Start index from which to return results. (optional) (default to null)
maxhitsperfile = 56 # Integer | Maximum number of matching lines returned per file. `0` returns all matching lines. (optional) (default to 0)
sort = sort_example # String | Sort order for results. (optional) (default to relevancy)
try:
# Return search results
api_response = api_instance.search(full=full, def=def, symbol=symbol, path=path, hist=hist, type=type, projects=projects, maxresults=maxresults, start=start, maxhitsperfile=maxhitsperfile, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling SearchApi->search: %s\n" % e)
extern crate SearchApi;
pub fn main() {
let full = full_example; // String
let def = def_example; // String
let symbol = symbol_example; // String
let path = path_example; // String
let hist = hist_example; // String
let type = type_example; // String
let projects = projects_example; // String
let maxresults = 56; // Integer
let start = 56; // Integer
let maxhitsperfile = 56; // Integer
let sort = sort_example; // String
let mut context = SearchApi::Context::default();
let result = client.search(full, def, symbol, path, hist, type, projects, maxresults, start, maxhitsperfile, sort, &context).wait();
println!("{:?}", result);
}