search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Getting Started with App Search

This guide will walk you through the first steps of setting up your App Search account, creating your first App Search Engine, indexing a small set of data, and testing out a few queries against your freshly created search engine index.

Step 1 - Signing up for a Swiftype Account

Your App Search account is where you manage your Engines, users, limits, and billing. If you have not done so already, sign up for your free App Search trial account. Once your email address has been confirmed, select the App Search product from the Swiftype Home product selector.

Signing Up - Access the App Search trial
Selecting the App Search product

Step 2 - Creating an Engine

An Engine is your search engine. It is an information repository that includes intelligently indexed document records and insightful search analytics data. It is the driving source behind dataset-level configurations such as facets, sorting, weights, and result positioning.

To create an Engine, locate and click the Create an Engine button from your account home page. Your Engine can be optimized to perform in many languages - choose the one that is right for you, or default to Universal.

Creating an Engine - Enter your new Engine's name
Creating an Engine
Take note! Your Engine name will be used as the identifier when making API calls or issuing search queries.

Step 3 - Locating Your API Credentials

After creating your first Engine, visit the Credentials in the App Search dashboard to find the various keys required for issuing API requests such as indexing documents and searching your data. For a complete authentication overview, click here.

API keys - Locate the Account Host key and API key
Credentials view

Step 4 - Indexing Documents

You are now ready to index documents into your Engine.

Swiftype App Search does not require you to define a schema prior to indexing your initial documents -- all fields are indexed as text by default. You can change the field type in the Schema tab of the App Search Dashboard or by using the Schema endpoint.

Using the .json importer, the raw JSON paste window, the API Client of your choice, or by simply using cURL to submit API requests, you can index up to 100 documents as an array of well formatted JSON.

Example - Indexing test documents into an Engine. Note that [HOST_IDENTIFIER], [ENGINE_NAME], and the [PRIVATE_API_KEY] are available within the Credentials tab.
curl -X POST 'https://[HOST_IDENTIFIER].api.swiftype.com/api/as/v1/engines/[ENGINE_NAME]/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [PRIVATE_API_KEY]' \
-d '[
      {
        "id": "INscMGmhmX4",
        "url": "https://www.youtube.com/watch?v=INscMGmhmX4",
        "title": "The Original Grumpy Cat",
        "body": "this is a test"
      },
      {
        "id": "JNDFojsd02",
        "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "title": "Another Grumpy Cat",
        "body": "this is also a test"
      }
    ]'

Example - Indexing a document within the rent-a-car engine
require 'swiftype-app-search'

client = SwiftypeAppSearch::Client.new(:host_identifier => '[HOST_IDENTIFIER]', :api_key => '[PRIVATE_API_KEY])
engine_name = '[ENGINE_NAME]'
documents = [
  {
    "id": "INscMGmhmX4",
    "url": "https://www.youtube.com/watch?v=INscMGmhmX4",
    "title": "The Original Grumpy Cat",
    "body": "this is a test"
  },
  {
    "id": "JNDFojsd02",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Another Grumpy Cat",
    "body": "this is also a test"
  }
]

begin
  index_document_results = client.index_documents(engine_name, documents)
  # handle index document results
rescue SwiftypeAppSearch::ClientException => e
  # handle error
end

Example - Indexing test documents into an Engine. Note that [HOST_IDENTIFIER], [ENGINE_NAME], and the [PRIVATE_API_KEY] are available within the Credentials tab.
from swiftype_app_search import Client
from swiftype_app_search.exceptions import SwiftypeAppSearchError

client = Client('[HOST_IDENTIFIER]', '[PRIVATE_API_KEY]')
engine_name = '[ENGINE_NAME]
documents = [
  {
    "id": "INscMGmhmX4",
    "url": "https://www.youtube.com/watch?v=INscMGmhmX4",
    "title": "The Original Grumpy Cat",
    "body": "this is a test"
  },
  {
    "id": "JNDFojsd02",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Another Grumpy Cat",
    "body": "this is also a test"
  }
]

try:
    index_document_results = client.index_documents(engine_name, documents)
except SwiftypeAppSearchError:
    # handle exception
    pass

Example - Indexing test documents into an Engine. Note that [HOST_IDENTIFIER], [ENGINE_NAME], and the [PRIVATE_API_KEY] are available within the Credentials tab.
const SwiftypeAppSearchClient = require('swiftype-app-search-node')

const client = new SwiftypeAppSearchClient('[HOST_IDENTIFIER]', '[PRIVATE_API_KEY]')
const engineName = '[ENGINE_NAME]'
documents = [
  {
    "id": "INscMGmhmX4",
    "url": "https://www.youtube.com/watch?v=INscMGmhmX4",
    "title": "The Original Grumpy Cat",
    "body": "this is a test"
  },
  {
    "id": "JNDFojsd02",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Another Grumpy Cat",
    "body": "this is also a test"
  }
]

client.indexDocuments(engineName, documents)
  .then((indexDocumentResults) => {
    // handle index document results
  })
  .catch((error) => {
    // handle error
  })

Example - Indexing test documents into an Engine. Note that [HOST_IDENTIFIER], [ENGINE_NAME], and the [PRIVATE_API_KEY] are available within the Credentials tab.
import com.swiftype.appsearch.Client;
import com.swiftype.appsearch.ClientException;
import java.util.*;

Client client = new Client("[HOST_IDENTIFIER]", "[PRIVATE_API_KEY]");
String engineName = "[ENGINE_NAME]";

Map<String, Object> doc = new HashMap<>();
doc.put("id", "INscMGmhmX4");
doc.put("url", "https://www.youtube.com/watch?v=INscMGmhmX4);
doc.put("title", "The Original Grumpy Cat");
doc.put("body", "this is a test");

List<Map<String, Object>> documents = Arrays.asList(doc);

try {
  List<Map<String, Object>> indexDocumentResults = client.indexDocuments(engineName, documents);
} catch (ClientException e) {
  // handle error
}

You may confirm that the documents were received by visiting the Documents tab of the App Search dashboard. You can refer to the API Logs tab of the dashboard or the API Logs API endpoint for more information on the requests being made against your Engine.

The Indexing Documents guide will help introduce you to the fundamental concepts behind document indexing. Or, you can head to the Documents API Reference to get building.

Step 5 - Searching Documents

There are multiple ways to query the content contained within your Engine. The most simple and expedient way to experiment with querying is using the Query Tester found in the App Search Dashboard:

Testing a query - Enter any term that matches one or more documents
Query Tester
The Search guide will introduce you to the core concepts of application search. If you would like to get right to using the API, the Search API Reference is there to aid you.

Step 6 - Create

You are now equipped to create an ideal search experience within your application. We hope that you enjoy all that App Search has to offer. If you want to speak with us, please email support at any time.

What's Next?

We covered the most important aspects of interacting with an App Search Engine, but now it is time to dive deeper into key concepts like Authentication, Document Indexing, and Search. After that, you can start crafting whatever you can imagine. Enjoy!


Stuck? Looking for help? Contact Support!