Giter Site home page Giter Site logo

Multiples queries search about dart_algolia HOT 4 CLOSED

knoxpo avatar knoxpo commented on August 22, 2024
Multiples queries search

from dart_algolia.

Comments (4)

nhathiwala avatar nhathiwala commented on August 22, 2024 2

@olamarche Good news! Multi-Query option is now supported. Update the SDK version to ^0.1.6

We have created a whole new interface just for Multi-Query. You can perform the following action:

  1. Add Query .addQuery(AlgoilaQuery query)
  2. Add Queries .addQueries(List<AlgoilaQuery> queries)
  3. Clear Queries .clearQueries()
  AlgoliaQuery queryA = algolia.instance.index('users').search('john');
  AlgoliaQuery queryB = algolia.instance.index('jobs').search('business');

  // Perform multiple facetFilters
  queryA = queryA.setFacetFilter('status:active');
  queryA = queryA.setFacetFilter('isDelete:false');

  // Perform multiple facetFilters
  queryB = queryB.setFacetFilter('isDelete:false');

  // Get Result/Objects
  List<AlgoliaQuerySnapshot> snap =
      await algolia.multipleQueries.addQueries([queryA, queryB]).getObjects();  

from dart_algolia.

Mikkelet avatar Mikkelet commented on August 22, 2024

I would LOVE this too <3

from dart_algolia.

nhathiwala avatar nhathiwala commented on August 22, 2024

Hi @olamarche & @Mikkelet,

Thank you all for selecting dart_algolia package for your Dart projects and supporting the development.

Multiple queries are in our pipeline of our TODOS, we should be rolling-out that functionality by the end of this May.

Till then you can use an alternative method, I know it's not that efficient as Multiple queries, but just a workaround:

   AlgoliaQuery queryA = algolia.instance.index('indiceA').search('john');
   AlgoliaQuery queryB = algolia.instance.index('indiceB').search('john');

   // Perform multiple facetFilters
   queryA = queryA.setFacetFilter('status:published');
   queryA = queryA.setFacetFilter('isDelete:false');

   // Perform multiple facetFilters
   queryB = queryB.setFacetFilter('status:published');
   queryB = queryB.setFacetFilter('isDelete:false');

   // Get Result
   List<AlgoliaQuerySnapshot> snap = await Future.wait([queryA.getObjects(), queryB.getObjects()]);

🍻

from dart_algolia.

olamarche avatar olamarche commented on August 22, 2024

@nhathiwala Thank you for the fix
I'm look forward for the next release!

from dart_algolia.

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.