SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-386
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Shay Banon
Reporter: Lukas Vlcek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Compass

CompassSearchHelper throws IllegalArgumentException when hits length < page size and asking for next page

Created: 17/Apr/07 04:07 PM   Updated: 15/Mar/08 03:59 AM
Component/s: Compass::Core
Affects Version/s: 1.1 GA
Fix Version/s: 1.2 M1

File Attachments: 1. Text File CompassSearchHelperFix.patch (3 kB)



 Description  « Hide
CompassSearchHelper throws IllegalArgumentException. Example follows:
Lenght of search hits is 5 and page size is 10 (in general page size is greater then hits length). The first page is returned correctly but API allows for asking for the next (second) page. This leads to exception:

[junit] Can't preload with negative from [-5]
[junit] java.lang.IllegalArgumentException: Can't preload with negative from [-5]
[junit] at org.compass.core.impl.DefaultCompassDetachedHits.<init>(DefaultCompassDetachedHits.java:53)
[junit] at org.compass.core.impl.DefaultCompassHits.detach(DefaultCompassHits.java:91)
[junit] at org.compass.core.support.search.CompassSearchHelper.performSearch(CompassSearchHelper.java:120)
[junit] at org.compass.core.support.search.CompassSearchHelper$1.doInCompass(CompassSearchHelper.java:82)
[junit] at org.compass.core.CompassTemplate.execute(CompassTemplate.java:137)
[junit] at org.compass.core.support.search.CompassSearchHelper.search(CompassSearchHelper.java:79)



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Lukas Vlcek added a comment - 17/Apr/07 04:10 PM
Here is patch. Please review it, any comments welcomed!

Shay Banon added a comment - 18/Apr/07 04:16 AM
Applied the patch, thanks!