Skip to main content

Global Search

Using Global Search in the Pieces desktop app

Global Search allows you to search for code semantically to help you find something you may otherwise have trouble navigating to. You can use whole sentences like "functions that transform arrays", or "Flutter widgets that are stateful" to get code snippets related to the problem that you are trying to solve.

To access Global Search in the Pieces Desktop App, select Copilot & Global Search from the dropdown menu in the upper left corner where other views like Workflow Activity and Snippet Discovery live.

Once you arrive at the Global Search View, you can start to type into the search bar located at the top of the app. You can either press / to toggle into the search bar, or click to select it.

Some other helpful information:

  • You can press Esc 2x to clear the search bar
  • You can press Esc (when the search bar is not focused) to navigate back to the List View or Gallery View, depending on which one you came from

Using Search Queries

The queries here are limitless, but learning to craft the right search is important. Here are a few examples that we use every day and the types of snippets that are returned:

QueryResult(s)Explanation
csv file readerPython Parse Data CSV, Importing Country DataPython Parse Data CSV is self explanatory, but the description on 'Importing County Data' states it "loads a csv file from a URL and prints the first 5 rows.
firebase deployFirebase Hosting Deployment with GitHub ActionsRelated to 'deploying a firebase app' (this user uses GitHub frequently.)
promise helperPromise Resolution Helper FunctionSmart Tagged with 'Future' and description talks about sync.
js sleep functionCommonJS Conversion Function, Promise-based Sleep FunctionGenerated title match, code language match, CommonJS related match.

Suggested Searches

While there are a number of custom queries that you could type every time, why would you? When you are in the Global Search View, you can see a generated list of search queries that are specific to the code you save.

To get a new set of suggested searches, simply press the "refresh" icon next to "Suggested Searches" above the pills.

Understanding Search Results

When you perform a search, you will have three main sections that will show up pertaining to the query.

  1. The snippets that match your results will be in vertical cards containing:
    • The Title of the Snippet
    • The Description of the Snippet
    • An "Expand Code" dropdown to see a specific snippet's code/text contents
    • A Productivity Score that roughly estimates how much you use a snippet and how useful it is to you
    • A related link to the source that the resource came from, e.g., Saved using the Pieces Web Extension
  2. Related tags between the results that you have:
    • Each tag that can be seen is included on one of the results. You can click on it to see which other snippets that have been returned in the search also have that tag.
  3. Related Links
    • The Related Links across the search results
    • Searching using a description such as "building widgets in Flutter," then using the Related Links results to research a topic is a great way to utilize this feature