Forum Discussion
Hi Sylvain,
have you checked out an article on TKB here - http://lithosphere.lithium.com/t5/Support-Knowledge-Base/Working-with-Rest-API-search/ta-p/39942 . There are some nice pointers there.
In terms of pulling data from two sources - it really depends on what you're trying to achieve. If you are after sequencial displaying of the results, then the above approach by Claudius might work for you, i.e. call first board and paginate results until they run out, then start the second one.
However, if you're after something a bit more flexible in terms of allowing for sorting by date for example, I think your best bet is to pull all the available search results into a single list and then do the pagination yourself.
In terms of the query parameters - here's some info:
1) f (optional) : string - Search field. - you can specify which specific fields you would like to be searched, e.g. subject, body, teaser, attach, tags - this depends on the type of search you're doing
2) q (optional) : string - Search text. - search query
3) phrase (optional) : string - A phrase.You can search for an exact phrase rather than just keyword
4) one_or_more (optional) : string- One or more term. Not 100% sure, but I think its one or more terms present in the message, an equivalent to logical AND / OR. So for example, ?one_or_more=apple%20orange should return posts which include either apple or orange, or both.
Hope this helps,
p.s. would be curious to hear about your final solution algorithm!
Best regards
Kirill
Hi kyershov,
"However, if you're after something a bit more flexible in terms of allowing for sorting by date for example, I think your best bet is to pull all the available search results into a single list and then do the pagination yourself."
I think it's not a valid solution.
Take a look to my table :
5 messages | |||
2.5 ko | |||
nb messages | ko | mo | go |
5 | 2,5 | 0,0025 | 0,0000025 |
3000 | 1500 | 1,5 | 0,0015 |
10000 | 5000 | 5 | 0,005 |
100000 | 50000 | 50 | 0,05 |
nb users | |||
300 | 450000 | 450 | 0,45 |
300 | 1500000 | 1500 | 1,5 |
300 | 15000000 | 15000 | 15 |
(tell me if i have done a mistake)
if a search returns 100.000 messages. 300 users will download 15 go of data. (based on 5 messages returns 2.5ko)
I think the only solution is to create an improvement on your API.
"p.s. would be curious to hear about your final solution algorithm!"
we have chosen to limit the filter to one category...