Home > Enterprise >  Global Search functionality using Java and BigQuery
Global Search functionality using Java and BigQuery

Time:12-04

My application has a search Textbox, where user input should give suggestions (predictive search), and when user selects one of the suggestions, I have to pull data from multiple tables from BigQuery.

Few questions about implementation of this.

  1. There is no way to preload suggestions, I have to fire API call based on every keystroke, pretty much like Google , this will affect performance, but then I have to add some technique at the backend, like search indexes. Right now I am using wildcard search for all tables pull, not really sure if it is really useful in the long run when data size is 10x bigger than now.

I am not looking for readymade code. Just need guidance, whether preloading is actually possible? because there is no way to know what user will type in text box.

  1. Google Cloud Search autocomplete feature (SearchApplication API) can be used with BigQuery?

Any suggestions please. Thanks

I am I am using wild card search to search in all tables using REGEX_CONTAINS() for predictive search API.

CodePudding user response:

There are several ways to implement predictive search in your application using BigQuery. One option is to use the REGEX_CONTAINS function, which allows you to perform a regular expression search on a string. This can be useful for implementing a predictive search feature that suggests matching results as the user types.

To optimize the performance of your predictive search feature, you can use search indexes in BigQuery. Search indexes allow you to pre-compute the results of a query and store them in a separate table. This can significantly improve the performance of your queries, especially for queries that involve large datasets or complex search criteria.

Another option is to use the Google Cloud Search autocomplete feature, which allows you to provide suggestions as the user types in a search query. This feature is built on top of the Google Cloud Search index, which is a scalable and performant search engine that is optimized for search queries.

To use the Google Cloud Search autocomplete feature with BigQuery, you can create a Cloud Search index that includes the data from your BigQuery tables. Then, you can use the Cloud Search API to query the index and provide suggestions to the user based on their input. This can provide a more performant and scalable solution for predictive search in your application.

Overall, there are several options for implementing predictive search in your application using BigQuery. You can use the REGEX_CONTAINS function, search indexes, or the Google Cloud Search autocomplete feature, depending on the specific requirements and constraints of your application.

  • Related