Giter Club home page Giter Club logo

Comments (18)

dethi avatar dethi commented on July 21, 2024

Hi,
Well, I can make this one public if you want. But it will be able to cancel only the last 10 queries.
Do you need more?

from algoliasearch-client-swift.

schmittsfn avatar schmittsfn commented on July 21, 2024

Hi @dethi,

Awesome, no that would work perfectly.

I noticed that the path parameter requires endpoints that are defined internally: e.g

public func multipleQueries(queries: [AnyObject], block: CompletionHandler? = nil) {
        let path = "1/indexes/*/queries"

Would it be a pain to implement the public method in a way to say: Cancel all previous X requests without specifying method and path? Or say: Cancel the previous X multipleQueries requests?

from algoliasearch-client-swift.

dethi avatar dethi commented on July 21, 2024

I will do it Thursday, with an enum to choose the type of operation to cancel. Is it ok for you?

from algoliasearch-client-swift.

schmittsfn avatar schmittsfn commented on July 21, 2024

Perfect, thank you so much!

Stefan

On Wed, Dec 9, 2015 at 2:10 PM, Thibault Deutsch [email protected]
wrote:

I will do it Thursday, with an enum to choose the type of operation to cancel. Is it ok for you?

Reply to this email directly or view it on GitHub:
#18 (comment)

from algoliasearch-client-swift.

dethi avatar dethi commented on July 21, 2024

Hi @sts2055
I just found that we have already a public method to cancel all the previous search, index.cancelPreviousSearch(). Is it sufficient for you?

from algoliasearch-client-swift.

schmittsfn avatar schmittsfn commented on July 21, 2024

Hi @dethi, thank you for your response.

Looks like that function would work great for me.

The Index class' initialiser is currently internal:

init(client: Client, indexName: String) {
        self.client = client
        self.indexName = indexName
        urlEncodedIndexName = indexName.urlEncode()
    }

I can't use this initialiser because it isn't public.

I have been searching for another way to instantiate the Index class, but couldn't find one.

from algoliasearch-client-swift.

dethi avatar dethi commented on July 21, 2024

https://github.com/algolia/algoliasearch-client-swift/blob/master/Source/Client.swift#L229-L234 :)

from algoliasearch-client-swift.

schmittsfn avatar schmittsfn commented on July 21, 2024

Thank you for your help!

from algoliasearch-client-swift.

tamimattafi avatar tamimattafi commented on July 21, 2024

@dethi Links not working, is there anyway to achieve the same for android, please ?

from algoliasearch-client-swift.

dethi avatar dethi commented on July 21, 2024

Hi @tamimattafi, I'm not working for Algolia anymore, but my former colleagues can probably guide you.
cc @redox to ping the current project owner

from algoliasearch-client-swift.

redox avatar redox commented on July 21, 2024

@dethi Links not working, is there anyway to achieve the same for android, please ?
cc @redox to ping the current project owner

@PLNech & @q-litzler are definitely the right people to talk to!

from algoliasearch-client-swift.

q-litzler avatar q-litzler commented on July 21, 2024

Hello @tamimattafi,

Every request from the Android client can be cancelled by calling cancel on its individual reference. Is this what you were looking for ?

Please note that the Android client is now in maintenance mode. This means that we no longer add feature to it, and only fix critical bugs.

We now recommend using the Kotlin client for Android development instead.

https://github.com/algolia/algoliasearch-client-kotlin

from algoliasearch-client-swift.

tamimattafi avatar tamimattafi commented on July 21, 2024

Hello @q-litzler, Thank you for your response

I'm considering switching to the Kotlin client but the Kotlin client requires using one of ktor's libraries, they all have some duplicated classes that prevent the IDE from compiling , is there a fix for this?

Also, my Algolia search query using the android-client isn't returning an exact result.
For example, writing the word TOTAL returns a query of 23 items, while using the search field on the web browser returns 49.

from algoliasearch-client-swift.

q-litzler avatar q-litzler commented on July 21, 2024

Can you share the exact error message for the ktor library, as well a quick overview of your gradle files ?

from algoliasearch-client-swift.

q-litzler avatar q-litzler commented on July 21, 2024

@tamimattafi can you please open an issue on https://github.com/algolia/algoliasearch-client-kotlin

from algoliasearch-client-swift.

tamimattafi avatar tamimattafi commented on July 21, 2024

@q-litzler I will switch to kotlin client during these 2 days, I will start an issue if needed.

from algoliasearch-client-swift.

tamimattafi avatar tamimattafi commented on July 21, 2024

@q-litzler I have added ktor dependency just for a simple compiling test

the result was following :
gradle sync : Success
project build/compile : Failure
Log : More than one file was found with OS independent path 'META-INF/kotlinx-io.kotlin_module'

  • excluding these classes from packaging in the gradle.build file shows more and more other duplicated classes.

  • navigating to the project libraries directory, exactly to ktor's one shows that all classes have a duplication or more.

used versions :
android studio : 3.4.1
kotlin : 1.3.41
gradle : default gradle wrapper
ktor : "io.ktor:ktor-client-android:1.2.2"

using androidx artifacts

from algoliasearch-client-swift.

q-litzler avatar q-litzler commented on July 21, 2024

Hello,

While I try to find a more proper solution to this, here is the complete list of files that you need to exclude:

    packagingOptions {
        exclude("META-INF/kotlinx-serialization-runtime.kotlin_module")
        exclude("META-INF/kotlinx-coroutines-core.kotlin_module")
        exclude("META-INF/ktor-http.kotlin_module")
        exclude("META-INF/kotlinx-io.kotlin_module")
        exclude("META-INF/atomicfu.kotlin_module")
        exclude("META-INF/ktor-utils.kotlin_module")
        exclude("META-INF/kotlinx-coroutines-io.kotlin_module")
        exclude("META-INF/ktor-client-json.kotlin_module")
        exclude("META-INF/ktor-client-json.kotlin_module")
        exclude("META-INF/ktor-client-logging.kotlin_module")
        exclude("META-INF/algoliasearch-client-kotlin.kotlin_module")
        exclude("META-INF/ktor-client-core.kotlin_module")
        exclude("META-INF/ktor-client-serialization.kotlin_module")
        exclude("META-INF/ktor-http-cio.kotlin_module")
    }

Let me know if this helps.

from algoliasearch-client-swift.

Related Issues (20)

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.