Solr扩展搜索仅返回前5行

时间:2015-10-27 22:05:38

标签: solr

我有以下Solr查询:

import UIKit
import CoreLocation

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate {
    var window: UIWindow?
    lazy var locationManager: CLLocationManager! = {
        let manager = CLLocationManager()
        manager.desiredAccuracy = kCLLocationAccuracyBest
        manager.pausesLocationUpdatesAutomatically = false
        manager.delegate = self
        manager.requestAlwaysAuthorization()
        return manager
    }()
    var lastNotifictionDate = NSDate()

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        let settings = UIUserNotificationSettings(forTypes: [.Alert], categories: nil)
        UIApplication.sharedApplication().registerUserNotificationSettings(settings)
        locationManager.startUpdatingLocation()
        return true
    }

    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        // Do something interesting.
        // I make this function return immediately until 10sec passed after previous notification.
        let now = NSDate()
        if lastNotifictionDate.dateByAddingTimeInterval(10).compare(now) == .OrderedDescending {
            //NSLog("Not yet")
            return
        }
        //NSLog("It's time")
        lastNotifictionDate = now

        // Fire local notification, without sound configured for simplicity.
        let notification = UILocalNotification()
        notification.alertBody = "Hello"
        UIApplication.sharedApplication().presentLocalNotificationNow(notification)
    }

    // ... other methods are untouched ...
}

在回复中,它显示找到了1000条记录。但是,Solr仅返回前5行。正如您所看到的,我添加了http://local:8983/solr/select?start=0&rows=1000& q=id:5332527& expand=true&expand.q=param_name_s:s21mag&expand.field=_root_ ,但这没有帮助。

如何强制Solr返回所有1000行?

1 个答案:

答案 0 :(得分:3)

  

expand.rows每组中显示的行数。默认值为5.

您需要在查询中包含expand.rows参数才能获得所需的结果数。

参考:Collapse and Expand Results