Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I call the K2SearchNew API with a valid sortSpec, but my results are not sorted. Why?

API results sorted valid
0
0 Posted

I call the K2SearchNew API with a valid sortSpec, but my results are not sorted. Why?

0
0

The K2SearchNew API has a sortSpec input. This input dictates whether the results returned by a search will be sorted or not. The result of this API is also governed by a server flag called vdkSortingFlag. If this flag is set to 0, the results of the search will not be sorted, regardless of the sortSpec. It can specify sorting in the K2 Dashboard by going to the Expert Settings of a server and setting the value for “VDK Field Sorting”. (This server flag can be seen as the vdkSortingFlag attribute of the SERVER in the admin.xml files.) When the flag is set to 1, all the results are sorted based on the input provided in sortSpec. The K2Server takes the top 500 (or the maxDocs value) of these results. In this case, the result obtained from the K2 APIs contains the top 500 (or maxDocs) results based on the sortSpec of all possible results. When the flag is set to 0, the results are sorted by score; thus the K2Server gets the 500 (or maxDocs) most relevant results based on the score. It the

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123