Discussion:
[mb-devel] how do we increase the 100 item limit of the SEARCH server?
Doron Tal
2015-03-13 20:43:25 UTC
Permalink
Hello all,

A quick question - I wonder if anybody has done this before:

I've set up a local server (the tomcat search server) and now I'm querying it but I noticed that both on the official server or my local one, when asking for a &limit=X - where X is > 100 - the limit is capped at 100.

MY QUESTION:

Has anybody successfully increased that 100-item limit? Since this is my local server being used, I want to use a limit of something like 2,000 - 10,000, not 100. Is there an easy way to do this?

I guess the question is: where in the code is that setting of 100? I couldn't find it easily. I'm not a java guy...

Any help would be greatly appreciated and I promise to share the answer back here in a clear manner -- I wouldn't be surprised if this were a common question.

Thanks!
-Doron
***@tracktunes.org
Paul Taylor
2015-03-13 22:14:06 UTC
Permalink
Post by Doron Tal
Hello all,
I've set up a local server (the tomcat search server) and now I'm
querying it but I noticed that both on the official server or my local
one, when asking for a &limit=X - where X is > 100 - the limit is
capped at 100.
Has anybody successfully increased that 100-item limit? Since this is
my local server being used, I want to use a limit of something like
2,000 - 10,000, not 100. Is there an easy way to do this?
I guess the question is: where in the code is that setting of 100? I
couldn't find it easily. I'm not a java guy...
Any help would be greatly appreciated and I promise to share the
answer back here in a clear manner -- I wouldn't be surprised if this
were a common question.
Thanks!
-Doron
Hi just removes lines 544 to 547 of

https://bitbucket.org/metabrainz/search-server/src/ed587b8b125c1ab0ba322cb8f54b50117ab03dbf/servlet/src/main/java/org/musicbrainz/search/servlet/SearchServerServlet.java?at=master


rebuild with

mvn install


Paul
Doron Tal
2015-03-14 14:41:13 UTC
Permalink
Paul, thanks so much!

You've saved me a lot of time.


I used a slightly different strategy, completely 100% based on yours, however:


TO CHANGE (YOUR LOCAL) SEARCH SERVER'S SEARCH LIMIT FROM 100 TO SOMETHING ELSE:


Change the constant: MAX_MATCHES_LIMIT = 100;


at the top of the file SearchServerServlet.java


E.g. change the line


final static int MAX_MATCHES_LIMIT = 100;


to

final static int MAX_MATCHES_LIMIT = 2000;



in the file


https://bitbucket.org/metabrainz/search-server/src/ed587b8b125c1ab0ba322cb8f54b50117ab03dbf/servlet/src/main/java/org/musicbrainz/search/servlet/SearchServerServlet.java?at=master


Then re-run mvn install, following the usual instructions in https://bitbucket.org/metabrainz/search-server


Or follow Paul's instructions (see below) to get rid of the limit altogether.


-Doron





---- On Fri, 13 Mar 2015 18:14:06 -0400 Paul Taylor <***@fastmail.fm> wrote ----

On 13/03/2015 20:43, Doron Tal wrote:

***@tracktunes.org" type="cite"> Hello all,

A quick question - I wonder if anybody has done this before:

I've set up a local server (the tomcat search server) and now I'm querying it but I noticed that both on the official server or my local one, when asking for a &limit=X - where X is > 100 - the limit is capped at 100.

MY QUESTION:

Has anybody successfully increased that 100-item limit? Since this is my local server being used, I want to use a limit of something like 2,000 - 10,000, not 100. Is there an easy way to do this?

I guess the question is: where in the code is that setting of 100? I couldn't find it easily. I'm not a java guy...

Any help would be greatly appreciated and I promise to share the answer back here in a clear manner -- I wouldn't be surprised if this were a common question.

Thanks!
-Doron
***@tracktunes.org

Hi just removes lines 544 to 547 of

https://bitbucket.org/metabrainz/search-server/src/ed587b8b125c1ab0ba322cb8f54b50117ab03dbf/servlet/src/main/java/org/musicbrainz/search/servlet/SearchServerServlet.java?at=master


rebuild with

mvn install


Paul
_______________________________________________
MusicBrainz-devel mailing list
MusicBrainz-***@lists.musicbrainz.org
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel

Loading...