GithubHelp home page GithubHelp logo

algoliasearch-client-objc's Issues

searchDisjunctiveFaceting function unavailable in ObjC API version 3.5

Hi,
I was trying to a disjunctive search using objective c API, when i searched through the api documentation, i found this

Query* query = [[Query alloc] initWithQuery:@"luxury"];
query.facets = @[@"facilities", @"stars"];
NSDictionary* refinements = @{
@"facilities": @[@"wifi"],
@"stars": @[@"4", @"5"]
};
[index searchDisjunctiveFaceting:query disjunctiveFacets:@[@"stars"] refinements:refinements completionHandler:^(NSDictionary* content, NSError* error) {
// [...]
}];

but when i try writing the code the function searchDisjunctiveFaceting doesn't appear.

Error message improvements

When hitting a 400 error, the errorMessage doens't include the actual API error: { "message": "......" }

Disjunctive Faceting

While I am working on advance search i am trying to use disjunctive faceting but not getting any idea how to implement it in objective c, as because I want to send multiple facet filtering data with “AND” and “OR” value together for algolia client search. Is it possible to do. Can you please tell me how.

AFNetworking 3.0, what should we do?

This issue aims to open the discussion about AFNetworking 3.0.

Brief: Currently, we use AFHTTPRequestOperationManager to manage the request. This class was removed in AFNetworking 3.0. Instead, we should use the another class (AFHTTPSessionManager) which is already available in AFNetworking 2.0. This class use the new API of Apple: NSURLSession (available since iOS 7.0) instead of NSURLConnection.

Pros: Well, AFNetworking 3.0 officially supports iOS 7+, Mac OS X 10.9+, watchOS 2+, tvOS 9. Currently, our version of AFNetworking doesn't support tvOS :(

Cons:

  • there are maybe some clients that still need to supports iOS 6?
  • dependency issue for all the project that expect AFNetworking 2.x (if we update to 3.0)

Disallow to change applicationID

Commit 73a3c7f allow the user to change the applicationID after the initialisation of ASAPClient. I think this is not a good idea, because in this case the header are changed but not the generated hostname.

And we can't auto-generate the new hostname. Indeed, the user has maybe the DSN option or uses only one host.

aroundLatLong not public anymore how to reset location aware search?

The ASQuery aroundLatLong used ti be public so when I wanted to query an index with
searchAroundLatitude method first and then requery it without location I used to set query.aroundLatLong to nil and that worked like a charm.

What is the recommended way now?
For sure I can build two queries but it's a bit sad...

Add a way to specify arbitrary query parameters

Add a way to specify query parameters by name and string value. This is intended as an untyped, low-level accessors to bypass limitations of the Query class (e.g. unsupported parameters).

Note: this is a backport of a feature already implemented in the upcoming v3 of the Swift client.

Remark: Solving this issue would automatically fix #23 and #24.

Wrong comparison type in ASQuery.m generates a warning at compile time

At line 292 in ASQuery.m this if statement compares wrong RHS type:

if (self.aroundLatLongViaIP != nil)

self.arounfLatLongViaIP is of type BOOL but nil cannot be used to compare BOOL values.

This generates a warning at compile time:

Comparison between pointer and integer ('int' and 'void *')

issue

Crash occured while experiencing 400 error

Hello guys,

our application just noticed crash in algolia search library and I was fortunate enough to have debugger plugged in, so I am sending the report to you.

Crash occured while basic query to one of the indexes we have in Algolia. We received 400 response (can't really tell why, never happened to us before) - then the crash occured:

ASAPIClient+Network.m

    AFHTTPRequestOperation *operation = [httpRequestOperationManager HTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *operation, id JSON) {
        if ((operation.response.statusCode / 100) == 2) {
            success(JSON);
        } else {
            failure(@"No error message");
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        if ((operation.response.statusCode / 100) == 4) {
            NSData *errorData = error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey];

           // Here, the crash occured, because errorData == nil
            NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData: errorData options:kNilOptions error:nil];
            failure([NSString stringWithFormat:@"Bad request argument: %@", JSON[@"message"]]);
        } else {
            if ((index + 1) < [managers count]) {
                [self performHTTPQuery:path method:method body:body managers:managers index:(index + 1) timeout:(timeout + 10) success:success failure:failure];
            } else {
                failure(error.description);
            }
        }
    }];

When I went through the variables in debugger, here is what I got:
(lldb) po error
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Unescaped control character around character 53.) UserInfo=0x171460d80 {NSDebugDescription=Unescaped control character around character 53., NSUnderlyingError=0x17024cea0 "Request failed: bad request (400)"}

(lldb) po operation
<AFHTTPRequestOperation: 0x1741cd890, state: isFinished, cancelled: NO request: <NSMutableURLRequest: 0x17420c160> { URL: https://AKEWZBYMIT-dsn.algolia.net/1/indexes/[OURINDEX]/query }, response: <NSHTTPURLResponse: 0x170824dc0> { URL: https://akewzbymit-dsn.algolia.net/1/indexes/[OURINDEX]/query } { status code: 400, headers {
"Access-Control-Allow-Credentials" = false;
"Access-Control-Allow-Headers" = "x-algolia-application-id, connection, origin, x-algolia-api-key, content-type, content-length, x-algolia-signature, x-algolia-usertoken, x-algolia-tagfilters, DNT, X-Mx-ReqToken, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Authorization, Accept";
"Access-Control-Allow-Methods" = "GET, PUT, DELETE, POST, OPTIONS";
"Access-Control-Allow-Origin" = "*";
Connection = "keep-alive";
"Content-Length" = 91;
"Content-Type" = "application/json; charset=UTF-8";
Date = "Wed, 29 Apr 2015 11:41:13 GMT";
Server = nginx;
} }>

The bug is pretty obvious, AFNetworking did not provide their underlaying error so it crashed. I suspect it will be very rare, but it still should be conditioned in case it happens to somebody else.

Have a nice day and keep up good work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.