ExpertRec Suggestion/Search API

Suggestion

suggestion

Request Suggestions


/suggestion/{api_key}/

Usage and SDK Samples

curl -X GET "https://searchv7.expertrec.com/v6/suggestion/{api_key}/?q=&ssize=&psize=&fq=&nf="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SuggestionApi;

import java.io.File;
import java.util.*;

public class SuggestionApiExample {

    public static void main(String[] args) {
        
        SuggestionApi apiInstance = new SuggestionApi();
        String apiKey = apiKey_example; // String | unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

        String q = q_example; // String | Search query
        Integer ssize = 56; // Integer | Number text suggestions to be retrieved
        Integer psize = 56; // Integer | Number Products to be retrieved
        String fq = fq_example; // String | Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded
        String nf = nf_example; // String | Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-

        try {
            inline_response_200 result = apiInstance.suggestion(apiKey, q, ssize, psize, fq, nf);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SuggestionApi#suggestion");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SuggestionApi;

public class SuggestionApiExample {

    public static void main(String[] args) {
        SuggestionApi apiInstance = new SuggestionApi();
        String apiKey = apiKey_example; // String | unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

        String q = q_example; // String | Search query
        Integer ssize = 56; // Integer | Number text suggestions to be retrieved
        Integer psize = 56; // Integer | Number Products to be retrieved
        String fq = fq_example; // String | Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded
        String nf = nf_example; // String | Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-

        try {
            inline_response_200 result = apiInstance.suggestion(apiKey, q, ssize, psize, fq, nf);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling SuggestionApi#suggestion");
            e.printStackTrace();
        }
    }
}
String *apiKey = apiKey_example; // unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

String *q = q_example; // Search query
Integer *ssize = 56; // Number text suggestions to be retrieved (optional) (default to 5)
Integer *psize = 56; // Number Products to be retrieved (optional) (default to 6)
String *fq = fq_example; // Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded (optional)
String *nf = nf_example; // Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-
 (optional)

SuggestionApi *apiInstance = [[SuggestionApi alloc] init];

// Request Suggestions
[apiInstance suggestionWith:apiKey
    q:q
    ssize:ssize
    psize:psize
    fq:fq
    nf:nf
              completionHandler: ^(inline_response_200 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ExpertRecSuggestionsearchApi = require('expert_rec_suggestionsearch_api');

var api = new ExpertRecSuggestionsearchApi.SuggestionApi()

var apiKey = apiKey_example; // {String} unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4


var q = q_example; // {String} Search query

var opts = { 
  'ssize': 56, // {Integer} Number text suggestions to be retrieved
  'psize': 56, // {Integer} Number Products to be retrieved
  'fq': fq_example, // {String} Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded
  'nf': nf_example // {String} Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.suggestion(apiKey, q, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class suggestionExample
    {
        public void main()
        {
            
            var apiInstance = new SuggestionApi();
            var apiKey = apiKey_example;  // String | unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

            var q = q_example;  // String | Search query
            var ssize = 56;  // Integer | Number text suggestions to be retrieved (optional)  (default to 5)
            var psize = 56;  // Integer | Number Products to be retrieved (optional)  (default to 6)
            var fq = fq_example;  // String | Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded (optional) 
            var nf = nf_example;  // String | Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-
 (optional) 

            try
            {
                // Request Suggestions
                inline_response_200 result = apiInstance.suggestion(apiKey, q, ssize, psize, fq, nf);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SuggestionApi.suggestion: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\SuggestionApi();
$apiKey = apiKey_example; // String | unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

$q = q_example; // String | Search query
$ssize = 56; // Integer | Number text suggestions to be retrieved
$psize = 56; // Integer | Number Products to be retrieved
$fq = fq_example; // String | Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded
$nf = nf_example; // String | Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-


try {
    $result = $api_instance->suggestion($apiKey, $q, $ssize, $psize, $fq, $nf);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SuggestionApi->suggestion: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SuggestionApi;

my $api_instance = WWW::SwaggerClient::SuggestionApi->new();
my $apiKey = apiKey_example; # String | unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

my $q = q_example; # String | Search query
my $ssize = 56; # Integer | Number text suggestions to be retrieved
my $psize = 56; # Integer | Number Products to be retrieved
my $fq = fq_example; # String | Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded
my $nf = nf_example; # String | Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-


eval { 
    my $result = $api_instance->suggestion(apiKey => $apiKey, q => $q, ssize => $ssize, psize => $psize, fq => $fq, nf => $nf);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling SuggestionApi->suggestion: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SuggestionApi()
apiKey = apiKey_example # String | unique search index identifier 
e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4

q = q_example # String | Search query
ssize = 56 # Integer | Number text suggestions to be retrieved (optional) (default to 5)
psize = 56 # Integer | Number Products to be retrieved (optional) (default to 6)
fq = fq_example # String | Facet query
Restrict results to  matching 

```fq=:```

where both field_name and field_value are url encoded (optional)
nf = nf_example # String | Numeric facet query
If facet is of numeric type (like a slider), results will be restricted between the min and max value specified.

`nf=:-`

min_value and max_value are optional. e.g.,
- For price between 500 and 20000 nf=price:500-20000
- For Price less than 1000 nf=price:-1000
- For Price greater than 1000 nf=price:1000-
 (optional)

try: 
    # Request Suggestions
    api_response = api_instance.suggestion(apiKey, q, ssize=ssize, psize=psize, fq=fq, nf=nf)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SuggestionApi->suggestion: %s\n" % e)

Parameters

Path parameters
Name Description
api_key*
String
unique search index identifier e.g., ccdb9cb6-5380-11e8-a8e3-12b6486824f4
Required
Query parameters
Name Description
q*
String
Search query
Required
ssize
Integer
Number text suggestions to be retrieved
psize
Integer
Number Products to be retrieved
fq
String
Facet query Restrict results to <field_name> matching <field_value> ```fq=<field_name>:<field_value>``` where both field_name and field_value are url encoded
nf
String
Numeric facet query If facet is of numeric type (like a slider), results will be restricted between the min and max value specified. `nf=<field_name>:<min_value>-<max_value>` min_value and max_value are optional. e.g., - For price between 500 and 20000 <code>nf=price:500-20000</code> - For Price less than 1000 <code>nf=price:-1000</code> - For Price greater than <code>1000 nf=price:1000-</code>

Responses

Status: 200 -