firestore_indexing_search 0.0.2 copy "firestore_indexing_search: ^0.0.2" to clipboard
firestore_indexing_search: ^0.0.2 copied to clipboard

A Flutter package that enables instant search on your firestore project

Firestore Indexing Search (IN BETA) #

DISCLAIMER: ONCE THE PACKAGE WILL BE ON RELEASE MODE, I WILL BE WRITTING AND UPDATING THE DOCUMENTATION, UNTIL THEN, PLEASE BEAR WITH ME.

Expected end of beta month is September 2020 This Flutter package will allow you to perform instant search on fields of your document. The package is still in beta, but perform as expected.

  • Some methods are yet to be implemented.
  • There is a UI Screen that demonstrate how the package works( in beta too), you can get it here
  • You need to use the SearchController in a specific maner in orther to be able to perform the search, please look at the example folder

here are the availiable methods that comes under the Indexer class

///Use this to scan your collections to check if your field is indexed here
isField(String named,{@required indexedInCollection, bool emptyBucket = false})

 ///Use this in case you dont want to index a particular document
  static Future<bool> removeIndexInField(
      {@required String named,
      @required String inCollection,
      @required String withDocumentId,
      bool showLogs = false})

  ///use this in case you want to index a particular document
  static Future<bool> addIndexInField(
      {@required String named,
      @required String inCollection,
      @required String withDocumentId,
      bool showLog = false})

 ///Use this  only when you need to remove an index from all your database's collection
  static Future<bool> removeAllIndex(
      {@required String inCollection,
      @required String indexedField,
      bool showLogs}) 

///Use this only when you need to index a field in all of your database's specific collection
  static Future<bool> indexDatabase(
      {@required String inCollection,
      @required String withFieldToIndex,
      bool showLogs = false})


   ///This will create an indexed field use it when you need to add more    ///data inside your database main document it is similar to
  ///Firestore.instance.collection(collectionName).add()
  ///However this method will add the specified field to the Indexer
  static Future addInCollection(String named,
      {@required String fieldToIndex,
      @required String fieldToIndexContent,
      Map<String, dynamic> others,
      bool allowEmptyAndNullCollection = false,
      bool showLogs = false})