Skip to content

Commit 7584460

Browse files
committed
feat: customRanking, ranking
1 parent b89aff1 commit 7584460

File tree

1 file changed

+232
-0
lines changed

1 file changed

+232
-0
lines changed

tests/CTS/requests/search/setSettings.json

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,238 @@
268268
}
269269
}
270270
},
271+
{
272+
"testName": "searchableAttributes same priority",
273+
"isSnippet": true,
274+
"parameters": {
275+
"indexName": "theIndexName",
276+
"indexSettings": {
277+
"searchableAttributes": [
278+
"title,comments",
279+
"ingredients"
280+
]
281+
}
282+
},
283+
"request": {
284+
"path": "/1/indexes/theIndexName/settings",
285+
"method": "PUT",
286+
"body": {
287+
"searchableAttributes": [
288+
"title,comments",
289+
"ingredients"
290+
]
291+
}
292+
}
293+
},
294+
{
295+
"testName": "searchableAttributes higher priority",
296+
"isSnippet": true,
297+
"parameters": {
298+
"indexName": "theIndexName",
299+
"indexSettings": {
300+
"searchableAttributes": [
301+
"title",
302+
"ingredients"
303+
]
304+
}
305+
},
306+
"request": {
307+
"path": "/1/indexes/theIndexName/settings",
308+
"method": "PUT",
309+
"body": {
310+
"searchableAttributes": [
311+
"title",
312+
"ingredients"
313+
]
314+
}
315+
}
316+
},
317+
{
318+
"testName": "customRanking retweets",
319+
"isSnippet": true,
320+
"parameters": {
321+
"indexName": "theIndexName",
322+
"indexSettings": {
323+
"customRanking": [
324+
"desc(retweets)",
325+
"desc(likes)"
326+
]
327+
}
328+
},
329+
"request": {
330+
"path": "/1/indexes/theIndexName/settings",
331+
"method": "PUT",
332+
"body": {
333+
"customRanking": [
334+
"desc(retweets)",
335+
"desc(likes)"
336+
]
337+
}
338+
}
339+
},
340+
{
341+
"testName": "customRanking boosted",
342+
"isSnippet": true,
343+
"parameters": {
344+
"indexName": "theIndexName",
345+
"indexSettings": {
346+
"customRanking": [ "desc(boosted)" ]
347+
}
348+
},
349+
"request": {
350+
"path": "/1/indexes/theIndexName/settings",
351+
"method": "PUT",
352+
"body": {
353+
"customRanking": [ "desc(boosted)" ]
354+
}
355+
}
356+
},
357+
{
358+
"testName": "customRanking pageviews",
359+
"isSnippet": true,
360+
"parameters": {
361+
"indexName": "theIndexName",
362+
"indexSettings": {
363+
"customRanking": [
364+
"desc(pageviews)",
365+
"desc(comments)"
366+
]
367+
}
368+
},
369+
"request": {
370+
"path": "/1/indexes/theIndexName/settings",
371+
"method": "PUT",
372+
"body": {
373+
"customRanking": [
374+
"desc(pageviews)",
375+
"desc(comments)"
376+
]
377+
}
378+
}
379+
},
380+
{
381+
"testName": "customRanking rounded pageviews",
382+
"isSnippet": true,
383+
"parameters": {
384+
"indexName": "theIndexName",
385+
"indexSettings": {
386+
"customRanking": [
387+
"desc(rounded_pageviews)",
388+
"desc(comments)"
389+
]
390+
}
391+
},
392+
"request": {
393+
"path": "/1/indexes/theIndexName/settings",
394+
"method": "PUT",
395+
"body": {
396+
"customRanking": [
397+
"desc(rounded_pageviews)",
398+
"desc(comments)"
399+
]
400+
}
401+
}
402+
},
403+
{
404+
"testName": "customRanking price",
405+
"isSnippet": true,
406+
"parameters": {
407+
"indexName": "theIndexName",
408+
"indexSettings": {
409+
"customRanking": [
410+
"desc(price)"
411+
]
412+
}
413+
},
414+
"request": {
415+
"path": "/1/indexes/theIndexName/settings",
416+
"method": "PUT",
417+
"body": {
418+
"customRanking": [
419+
"desc(price)"
420+
]
421+
}
422+
}
423+
},
424+
{
425+
"testName": "ranking exhaustive",
426+
"isSnippet": true,
427+
"parameters": {
428+
"indexName": "theIndexName",
429+
"indexSettings": {
430+
"ranking": [
431+
"desc(price)",
432+
"typo",
433+
"geo",
434+
"words",
435+
"filters",
436+
"proximity",
437+
"attribute",
438+
"exact",
439+
"custom"
440+
]
441+
}
442+
},
443+
"request": {
444+
"path": "/1/indexes/theIndexName/settings",
445+
"method": "PUT",
446+
"body": {
447+
"ranking": [
448+
"desc(price)",
449+
"typo",
450+
"geo",
451+
"words",
452+
"filters",
453+
"proximity",
454+
"attribute",
455+
"exact",
456+
"custom"
457+
]
458+
}
459+
}
460+
},
461+
{
462+
"testName": "ranking standard replica",
463+
"isSnippet": true,
464+
"parameters": {
465+
"indexName": "theIndexName",
466+
"indexSettings": {
467+
"ranking": [
468+
"desc(post_date_timestamp)"
469+
]
470+
}
471+
},
472+
"request": {
473+
"path": "/1/indexes/theIndexName/settings",
474+
"method": "PUT",
475+
"body": {
476+
"ranking": [
477+
"desc(post_date_timestamp)"
478+
]
479+
}
480+
}
481+
},
482+
{
483+
"testName": "ranking virtual replica",
484+
"isSnippet": true,
485+
"parameters": {
486+
"indexName": "theIndexName",
487+
"indexSettings": {
488+
"customRanking": [
489+
"desc(post_date_timestamp)"
490+
]
491+
}
492+
},
493+
"request": {
494+
"path": "/1/indexes/theIndexName/settings",
495+
"method": "PUT",
496+
"body": {
497+
"customRanking": [
498+
"desc(post_date_timestamp)"
499+
]
500+
}
501+
}
502+
},
271503
{
272504
"testName": "setSettings allow all `indexSettings`",
273505
"parameters": {

0 commit comments

Comments
 (0)