ios - multiple - 我的解析tableview搜索效率低下(swift/objectiveC)?



uitableview multiple selection (0)

所以我有一堆字段在我的解析服務器,我有我的iOS應用程序中的tableview。 每個單元格都有一堆數據,就像我之前說過的那樣。 但問題是我想讓用戶能夠搜索這些數據。 我的問題是,如果我可以說5萬pfobjects列表和我的解析服務器,並且一個用戶正在尋找這個很多領域,是非常昂貴的,或者是搜索不那麼昂貴。 請記住,所有搜索的內容都是小寫的,所以不會成為問題。 這是我的代碼。 我有31個字段正在搜索文本。 這是不好做的。 如果我有成千上萬的用戶,它會在服務器端增加很多賬單嗎? 這是我的代碼。

var query : PFQuery<PFObject>!
             query.order(byDescending: "createdAt")
            let fiel1 = PFQuery(className: "Real Estate")
            field1.whereKey("field one", contains: search)
            let field2 = PFQuery(className: "Real Estate")
            field2.whereKey("field two", contains: search)
            let field3 = PFQuery(className: "Real Estate")
            field3.whereKey("field three", contains: search)
            let field4 = PFQuery(className: "Real Estate")
            field3.whereKey("field four", contains: search)
            let field5 = PFQuery(className: "Real Estate")
            field5.whereKey("field 5", contains: search)
            let field6 = PFQuery(className: "Real Estate")
            field6.whereKey("field 6", contains: search)
            let field7 = PFQuery(className: "Real Estate")
            field7.whereKey("field 7", contains: search)
            let field8 = PFQuery(className: "Real Estate")
            field8.whereKey("field 8", contains: search)
            let field9 = PFQuery(className: "Real Estate")
            field9.whereKey("field 9", contains: search)
            let field10 = PFQuery(className: "Real Estate")
            field10.whereKey("field 10", contains: search)
            let field11 = PFQuery(className: "Real Estate")
            field11.whereKey("field 11", contains: search)
            let field12 = PFQuery(className: "Real Estate")
            field12.whereKey("field 12", contains: search)
            let field13 = PFQuery(className: "Real Estate")
            field13.whereKey("field 13", contains: search)
            let field14 = PFQuery(className: "Real Estate")
            field14.whereKey("field 14", contains: search)
            let field15 = PFQuery(className: "Real Estate")
            field15.whereKey("field 15", contains: search)
            let field16 = PFQuery(className: "Real Estate")
            field16.whereKey("field 16", contains: search)
            let field17 = PFQuery(className: "Real Estate")
            field17.whereKey("field 17", contains: search)
            let field18 = PFQuery(className: "Real Estate")
            field18.whereKey("field 18", contains: search)
            let field19 = PFQuery(className: "Real Estate")
            field19.whereKey("field 19", contains: search)
            let field20 = PFQuery(className: "Real Estate")
            field20.whereKey("field 20", contains: search)
            let field21 = PFQuery(className: "Real Estate")
            field21.whereKey("field 21", contains: search)
            let field22 = PFQuery(className: "Real Estate")
            field22.whereKey("field 22", contains: search)
            let field23 = PFQuery(className: "Real Estate")
            field23.whereKey("field 23", contains: search)
            let field24 = PFQuery(className: "Real Estate")
            field24.whereKey("field 24", contains: search)
            let field25 = PFQuery(className: "Real Estate")
            field25.whereKey("field 25", contains: search)
            let field26 = PFQuery(className: "Real Estate")
            field26.whereKey("field 26", contains: search)
            let field27 = PFQuery(className: "Real Estate")
            field27.whereKey("field 27", contains: search)
            let field28 = PFQuery(className: "Real Estate")
            field28.whereKey("field 28", contains: search)
            let field29 = PFQuery(className: "Real Estate")
            field29.whereKey("field 29", contains: search)
            let field30 = PFQuery(className: "Real Estate")
            field30.whereKey("field 30", contains: search)
            let objectId = PFQuery(className: "Real Estate")
            objectId.whereKey("objectId", contains: search)
            query = PFQuery.orQuery(withSubqueries: [field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19, field20, field21, field22, field23, field24, field25, field26, field27, field28, field29, field30, objectId])




swift3