Data Connect: Full Text Search, Enums, and More

As more and more of you adopt Data Connect, we’ve been listening to your feature requests on Firebase UserVoice. We’re excited to announce these new features that you can now use:

  • Full-text search: efficiently locate information within large datasets by searching for keywords and phrases across multiple columns at once.
  • Enum support: quickly define a list of static, predefined values with a specific order
  • SDK download: run a script from the console to set up the SDK for you
  • MCP support: use the Firebase MCP server to use Data Connect for working with data, retrieving schemas. Some of the tools use Gemini in Firebase to help you generate schemas and operations as well.

Read more below for more information about each one!

Data Connect now supports full-text search, powered by Postgres. Full-text search lets you quickly and efficiently locate information within large datasets by searching for keywords and phrases across multiple columns at once.

To add full-text search to your service, add the @searchable directive to String fields in your schema that you want to search over. For example:

type Movie
  @table {

  # The fields we want to search over
  title: String! @searchable
  genre: String @searchable
  description: String @searchable

  # Some other fields that we won't search over
  rating: Float
  imageUrl: String!
  releaseYear: Int
}

You can then perform full-text search across all of those fields by adding the <pluralType>_search field to a query. In this case, it’ll be movies_search:

# Find movies with searchTerm in their title, genre, or description
query SearchMovies($searchTerm: String) @auth(level: PUBLIC) {
  movies_search(query: $searchTerm) {
    id
    title
    imageUrl
    releaseYear
    genre
    rating
    description
  }
}

Fine-tuning full-text search results

You can imagine if we search on our entire dataset, there may be information we don’t actually want. To help with this, there are some ways to fine-tune search results:

  • Filters, limits, orders, and more: many of the same arguments used for list fields <pluralType> can be used to control your search results, such as order, where, limit, offset, and distinct.
  • Language choice: by default, documents get parsed in English. However, Data Connect supports nineteen languages out of the box. You can choose the right language, which improves accuracy and relevance of search results.
  • Query format: by default, full-text search uses web semantics for queries, similar to Google search. You can change this behavior if you want other query formats, such as matching all words or an exact phrase.
  • Relevance threshold: if you feel that some search results are irrelevant, you can set the relevance threshold to only receive results above the threshold

To add full-text search to your app today, check out the documentation.

Enum support

Data Connect now supports enums, powered by Postgres, and they let you quickly define a list of static, predefined values with a specific order.

To add an enum to your service, you first define the enum type along with its pre-defined values, and then you reference it in your table. In terms of using enums in your client app, they work just like types, queries, and mutations: you define these in GraphQL, and Data Connect automatically generates SDKs. The SDKs include your enums so they can be used in the generated types and operations.

For example:

enum Language {
  ENGLISH
  FRENCH
  SPANISH
  GERMAN
  JAPANESE
  "Languages not defined above"
  OTHER_LANGUAGES
}

type Movie
  @table {
  title: String! 
  genre: String 
  description: String 
  originalLanguage: Language! @default(value: ENGLISH)
  availableLanguages: [Language!]
  // other fields
}

You can also use the following features for enums:

  • Querying: use enums in your queries
  • Filtering: enums have the standard filtering actions available - eq, ne, ge, gt, lt, le, in, and nin, as well as includes, excludes, includesAll, and excludesAll for lists.
  • Use in aggregates: _count is supported for enums.
  • Add or Remove supported enum values: You can add new values to your enum. Because the order of the enum list is very meaningful, insert your new values wisely, and never reorder the values as doing so changes how filtering is applied.
  • Emulator support: Using the VS Code local emulator, you can test your enums.

For more details about enum support and the features listed above, feel free to check out the documentation.

SDK download

When using Data Connect, you use GraphQL to model your data and define CRUD operations. To actually get data and make changes from your client app, GraphQL needs to be translated into the language for the platform you’re developing. Data Connect does this automatically; it generates strongly-typed SDKs for web, Android, iOS, and Flutter based on the operations you have defined.

Previously, you had to set this up through the Firebase CLI and run a command to generate the SDKs. Now, you can do this more seamlessly using a script that downloads the SDKs for you! To do so, you can use:

  • the project-specific command found in Firebase Console as shown below
  • a generic command that works for all projects
  • the VS Code extension to generate client SDKs

To learn more about downloading the SDK for new projects that don’t have Data Connect set up yet, feel free to check out the documentation.

MCP Support

By connecting to Model Context Protocol (MCP) servers, coding agents can directly integrate with additional tools and services in a standardized fashion, extending the capabilities of AI tools. You can use the Firebase MCP server to give AI-powered development tools the ability to work with your Firebase projects.

With regards to Data Connect, an editor configured to use the Firebase MCP server can help you work with data and retrieve schemas, and some of the tools use Gemini in Firebase to help you generate schemas and operations.

To make MCP even more widely available, Gemini Code Assist released their MCP integration last month. Using Agent Mode, you can converse naturally and the agent will determine the proper MCP tools to use. The “Build your schema and queries with AI” button adds the Firebase MCP server if you haven’t already before taking you directly to Agent Mode.

Try it out!

We’re always incredibly excited to see what you build with Data Connect and these new features! Your feedback is invaluable as we use it for our roadmap going forward, so please continue to share your thoughts and requests on Firebase’s UserVoice!