Forum Discussion
Hi Claudius,
1) Do you want to combine the result of both searches and then show those combined results using pagination?
yes, i wish to search in 2 forums and paginate the result.
by example,
nbResultByPage = 10
/restapi/vc/categories/id/forum1/search/messages/?q=test > return 12 results
/restapi/vc/categories/id/forum2/search/messages/?q=test > return 20 results
i with to get this result
PAGE 1 : 0-10 of forum1
PAGE 2 : 11-12 of forum1 + 0-8 of forum2
PAGE 3 : 9-19 of forum2
PAGE 4 : 20 of forum2
i have tried to use :
/restapi/vc/categories/id/forum1/id/forum2/search/messages/?q=test
but this does not work.
"The second part of your question I don't know the answer for either. Would be interesting to know what difference between the f, q and phrase parameters actually is and how the one_or_more parameter influences the result? @Lithium_devs"
yes what is the difference between this parameters and what is the influence of one_or_more parameter ?
What sometimes helps in answering API questions is taking a look at the page URL when using the community search page and applying some filters.
I couldn't find a way both there or VIA API to filter by multiple locations. So probably you need to work around a bit like that (Pseudocode):
if (number_resultsperpage_from_firstboard => results_per_page) { // If the results from the first board already fill a page only show those } else { //on the page first show the results from the first board and then have another API call to pull results from second board to fill up the page with parameter page_size = results_per_page - number_resultsperpage_from_firstboard }
i know that's very rough because it does not include all of the pagination checking, but I hope you get the general idea.
At least I can reply the second part of the question:
On the "Search" page of your community click on "Advanced Search" and you will see the three parameters as input fields together with small (i) icons with a more detailed explanation.
Related Content
- 2 years ago
- 11 months ago
- 13 years agoInactive User
- 2 years ago