Erick Heredia
02/01/2022, 2:37 PMvalue
should be a string or a string array."}".
value specs:
{
"facet": false,
"index": true,
"name": "value",
"optional": false,
"type": "float"
},
Erick Heredia
02/01/2022, 2:37 PMErick Heredia
02/01/2022, 2:39 PMx-typesense-api-key
header must be sent."}`Erick Heredia
02/01/2022, 2:40 PMErick Heredia
02/01/2022, 2:42 PMErick Heredia
02/01/2022, 3:10 PMErick Heredia
02/01/2022, 3:11 PMKishore Nallan
02/01/2022, 3:11 PMErick Heredia
02/01/2022, 3:13 PMKishore Nallan
02/01/2022, 3:14 PMErick Heredia
02/01/2022, 3:14 PMawait client!.collection(collection).documents.search({
"q": value ?? "*",
"query_by": queryBy,
});
Kishore Nallan
02/01/2022, 3:16 PMErick Heredia
02/01/2022, 3:16 PMErick Heredia
02/01/2022, 3:19 PMclass SearchService {
Client? client;
String searchOne = "add-endpoint-here";
String searchTwo = "add-endpoint-here";
String searchThree = "add-endpoint-here";
void initialize(String searchKey) {
var config = Configuration(
searchKey,
nodes: {
Node(Protocol.https, searchOne, port: 443),
Node(Protocol.https, searchTwo, port: 443),
Node(Protocol.https, searchThree, port: 443),
},
connectionTimeout: Duration(seconds: 2),
);
client = Client(config);
}
Future<dynamic> Search(
String? value,
String queryBy,
String collection,
) async {
try {
var search = await client!.collection(collection).documents.search({
"q": value ?? "*",
"query_by": queryBy,
});
return search;
} catch(err){
return err;
}
}
Kishore Nallan
02/01/2022, 3:24 PMErick Heredia
02/01/2022, 3:29 PMErick Heredia
02/01/2022, 3:30 PMErick Heredia
02/01/2022, 3:30 PMKishore Nallan
02/01/2022, 3:30 PMErick Heredia
02/01/2022, 3:35 PMErick Heredia
02/01/2022, 3:36 PMErick Heredia
02/01/2022, 3:44 PMErick Heredia
02/01/2022, 3:44 PMKishore Nallan
02/01/2022, 3:45 PMErick Heredia
02/01/2022, 3:45 PMKishore Nallan
02/01/2022, 3:45 PMErick Heredia
02/01/2022, 3:46 PMErick Heredia
02/01/2022, 4:04 PMErick Heredia
02/01/2022, 4:04 PMKishore Nallan
02/01/2022, 4:04 PM