Application Builder is deprecated and will be removed in a future release of MarkLogic Server.
This chapter gets you started using Application Builder, a browser-based application that quickly creates fully functional search and analytics applications. These generated applications can, if needed, be customized and extended. This chapter includes the following sections:
Using Application Builder requires no coding on your part. Its user interface is easy to use, while its search applications can have many high-end search features such as a search box with Google-style search grammar, search suggestions, faceted navigation, and results visualization widgets. It scales for huge database sizes while maintaining its speed.
The generated application uses the Search API and can be used as is or customized with your own code.You can define many aspects of an application, such as:
Typically, building an application is an iterative process. To begin, you must have a representative content set loaded in a database with any needed indexes already set up. If your content is not complete or not completely indexed, you can still generate an application and modify it as you modify your content.
In this chapter, you use Application Builder to generate a sample application based on data about the Oscar awards. For details, see Building the Oscars Sample Application and Using the Oscars Sample Application.
Application Builder is bundled with MarkLogic Server Application Services. On a fresh installation of MarkLogic 8, Application Builder is preconfigured and ready to use. For an upgrade installation, your existing application data remains intact although some renaming of your Application database and App Server may occur during the installation process. This section describes the following scenarios:
When you install MarkLogic Server for the first time, the installation process does the following:
App-Services
on port 8000 for Application ServicesApp-Services
to store the Application Builder application documentsFor a complete description of installing MarkLogic Server, see Installing MarkLogic in the Installation Guide.
To start Application Services, open a browser and go to your server's port 8000. For example, if your browser runs on the same machine as MarkLogic Server, open the following URL:
http://localhost:8000/appservices
When MarkLogic Server prompts you for a username and password, enter them for a user with either the admin
or app-builder
role.
For details on these roles, see Predefined Roles for Application Builder.
Application Builder includes a template to build a sample application based on Oscar awards data from Wikipedia. To build this application, go through the Application Builder wizard as follows:
http://localhost:8000/appservices
For details about controlling access to your new application, see Controlling Access to Application Builder and to Generated Applications.
When you deploy an application, it appears in a new browser window using a URL whose hostname is what is stored in the MarkLogic Server configuration files (the result of an xdmp:host-name call). If you are running on a laptop computer that is changing networks, the hostname might not be available on your network, resulting in a 404 or similar error when the application launches (because it is trying to access a server name unavailable on your current network). Substituting localhost
for the hostname in the URL should fix this.
Initally, Application Builder only loads a few sample data files for use by the Oscars application. To load the full 20 MB content set, use the following steps:
/oscars/{$filename}{$dot-ext}
The data downloads automatically over your Internet connection, while a spinning icon appears until the load is complete. When done, you will see different count values and additional facet values.
While downloading the sample page, do not navigate away from it or close the browser window until the spinning icon disappears and the page reloads, otherwise the download might be interrupted.
The Oscars sample application enables you to search, browse, and display articles about Oscar award winners from the last nine decades. It is uses the Search API's standard features, including query text parsing, faceted navigation, snippetting, and many more. For details about the Search API, see Search API: Understanding and Using in the Search Developer's Guide.
While you can learn about the application by playing with it, this section highlights some of its main features, including:
You can enter keywords into the search box and press return to search the database. For example, a search for raymond
shows snippets for the first 10 of 37 results.
As you type search terms, the application suggests your possible full search. For example, as you type Ingrid Bergman
, you might see something like the following:
Because the application uses the Search API, you can use standard search grammar such as combining multiple terms with AND semantics, treating double-quoted phrases as phrases, and so on. For information about the search grammar for the Search API, see Search API: Understanding and Using in the Search Developer's Guide.
You can also search using constraints. For example, the following query text finds everything about the actor Dustin Hoffman:
actor:"Dustin Hoffman"
This is not a standard full-text search, but is a constraint showing all the documents matching where an particular value in the source XML, <actor>,
has the content Dustin Hoffman
. You can combine the constraint with other terms to further narrow the results:
buck actor:"Dustin Hoffman"
When you click on any links in the user interface, notice that the query text in the search box shows the current query.
The left side of the application shows facets used to browse through the content. When you click on a facet, it narrows the overall search results to those results in the facet's category, while keeping the existing categories or search terms active.
For example, if you first click on the Award:Best Director browse link, then on the Decade:1970s link, and then on the Winners:True link, your results are all of the 1970s winners of the Best Director award.
Each of the browse facets has a count of how many of its results match your current query.
The search result page shows a link with a text summary of the content, highlighted snippets of the content matching your search, and other information about the search match. Clicking the result link takes you to the content details.
The content details page includes the complete content for the search result. The rendering is based on the configuration specified on Application Builder's Content Display page. The page's style is based on the skin you chose and on any custom CSS entered on the Appearance page.
This section describes how to add a year facet to the Oscars application. With the year facet, you can first drill down on results with the decade facet, then drill down further using the year facet. The year facet uses the same index as the decade facet.
To create a year facet, do the following:
http://localhost:8000/appservices
in a browser).Oscars
).The year facet in this example is available at all times, whether or not you have clicked on the decade facet. To only display the year facet after selecting a decade, you need to add additional display logic. The Oscars example application is not set up to do hierarchical logic, but you can modify it to do so. For details on modifying the application, see Extending Applications Built With Application Builder.