Only get 20 results from API

Discussion in English language.
Forumsregeln
You can start and continue with posts in english language in all other forums as well, but if you are looking for a forum to start a discussion in english, this is the right choice.

Only get 20 results from API

Beitragvon davide » Mo Okt 26, 2015 12:54 am

I created an account from ConfigAccounts_p.html with the permission Extended Search right.
Whatever I search with the following query, always returns exactly 20 results:

Code: Alles auswählen
# example
curl "http://yacy_username:password@192.168.1.109:8090/yacysearch.json?query=my+url-encoded+query&maximumRecords=200&resource=local"


How can I get more results?
davide
 
Beiträge: 84
Registriert: Fr Feb 15, 2013 8:03 am

Re: Only get 20 results from API

Beitragvon chris92 » Mi Mai 18, 2016 3:45 pm

did you already find out how to get more results?
chris92
 
Beiträge: 3
Registriert: Mi Mai 18, 2016 3:44 pm

Re: Only get 20 results from API

Beitragvon davide » Mi Mai 18, 2016 3:54 pm

I found out that the API is nonfunctional, as well as the whole ranking algorithm. These are pragmatic facts I already wrote about, and you can find confirmations via google.

Moreover, what is instead my opinion, is that the project leadership is roaming toward messy random goals rather than a defined roadmap. What results is that, after 10 years of development, Yacy still suffers major design defects and is, in fact, entirely broken, as you may google for.
davide
 
Beiträge: 84
Registriert: Fr Feb 15, 2013 8:03 am

Re: Only get 20 results from API

Beitragvon chris92 » Mi Mai 18, 2016 4:55 pm

ok thank you for pointing that out, I will think about this.

nevertheless, if anyone is reading this and is still interested in the answer to the question - I figured out how to get more results.

There is a parameter called "startRecord". At first you set it to 0. If you got 20 results you set it to 20, got another 20 --> set it to 40 and so on.
chris92
 
Beiträge: 3
Registriert: Mi Mai 18, 2016 3:44 pm

Re: Only get 20 results from API

Beitragvon davide » Mi Mai 18, 2016 5:04 pm

Have a lot of fun.
davide
 
Beiträge: 84
Registriert: Fr Feb 15, 2013 8:03 am

Re: Only get 20 results from API

Beitragvon luc » Mi Mai 18, 2016 5:12 pm

Hi, I just tried this API call with a YaCy node deployed from latest sources and you now effectively have more than 20 results as desired.

Davide, this project has maybe not became as active as we could expect since your initial report, but at least some bugs are fixed ... so your reporting is not as useless as you might think ;)
luc
 
Beiträge: 300
Registriert: Mi Aug 26, 2015 1:04 am

Re: Only get 20 results from API

Beitragvon chris92 » Mi Mai 18, 2016 5:28 pm

I also got more than 20. But always in chunks of 20 per request.
And I just tried to get many results and noticed it always stops after the first 200. Even if there should come about 1000-3000.
chris92
 
Beiträge: 3
Registriert: Mi Mai 18, 2016 3:44 pm

Re: Only get 20 results from API

Beitragvon luc » Do Mai 19, 2016 8:37 am

There was a fix for chunks size in January : https://github.com/yacy/yacy_search_ser ... a7dc1973f5.
So if you run a yacy version upper than v1.83/9654 you should be able to have up to 100 results per request. I am running a yacy 1.83/9816 and it works.
You can even theorically have up to 1000 results per request if you set the "Snippet Fetch Strategy" (in http://localhost:8090/ConfigPortal.html) to "CACHEONLY" or "FALSE".

But you are right that getting last results is still not currently working. With my node it always ends at (page size x 10) or at a few hundreds when maximumRecords is set to 1000 with CECHEONLY strategy.

So effectively this can give some fun work for a goodwill one who would like to fix it one and for all!
luc
 
Beiträge: 300
Registriert: Mi Aug 26, 2015 1:04 am

Re: Only get 20 results from API

Beitragvon luc » Fr Mai 27, 2016 4:08 pm

Hi, I was thinking and just tested another workaround (maybe a bit late) : if your intend is to get json results coming only from your peer index, another solution is to use directly embedded solr api. Of course the output format won't be the same as yacysearch servlet, but this way is reliable to get ALL results, with page size up to 100, starting at any page.

Thus your inital query :
Code: Alles auswählen
curl "http://youhost:8090/yacysearch.json?query=my+url-encoded+query&maximumRecords=200&resource=local"


could be translated to :
Code: Alles auswählen
curl "http://youhost:8090/solr/select?q=my+url-encoded+query&wt=json&start=0&rows=100&core=collection1"


and you may loop, increasing start by 100 on each step, or jump directly to the page you wish.
luc
 
Beiträge: 300
Registriert: Mi Aug 26, 2015 1:04 am


Zurück zu English

Wer ist online?

Mitglieder in diesem Forum: Bing [Bot] und 3 Gäste