Before you begin, you need to be registered to use Aspire (go to https://aspire.searchtechnologies.com/) if you haven't already done that. You will need your user registration name and password in order to complete this tutorial.
The version of Java you should use depends on the Aspire version you are targeting:
Note that we recommend installing the Java JDK (Java Development Kit), just in case you want to create your own Aspire Components in the future. But really, only the JRE (Java Runtime Environment) is absolutely required.
> java -version java version "11.0.2" 2019-01-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
Download and unpack Aspire Binaries. For purposes of this tutorial, we'll use "aspire-distribution-4.x" as the directory name to which you unpack Aspire.
This is not the best way to create a new Aspire Distribution. The official method is to use the Distribution Archetype, which requires also downloading a Maven client. There's a separate tutorial for getting started using this method: Aspire Quick Start with Distribution Archetype.
The download will create a directory structure similar to that described in Directory Structure.
Go to the directory where you unpacked Aspire (such as "aspire-distribution-2.2.2") and type "config" to go to the configuration directory. Open the settings.xml file with a text or XML editor. Look for the maven repository tag. You need to replace the user name and password that displays with the user name and password you used to register for Aspire.
<repository type="maven"> <defaultVersion>4.x</defaultVersion> <remoteRepositories> <remoteRepository> <id>stPublic</id> <url> http://repository.searchtechnologies.com/artifactory/simple/community-public/ </url> <user>YOUR-USERNAME-HERE</user> <password>YOUR-PASSWORD-HERE</password> </remoteRepository> </remoteRepositories> </repository>
Once you've entered your user name and password, save the file.
First, make sure you have access to the internet so that Aspire can download components. Next, still in the Aspire directory you created, change to the bin directory and type "aspire" to launch Aspire.
Note that "aspire" is a batch script (on Windows) or a shell script (on Unix) that can be modified as necessary if you need more memory or need to set other system properties.
Aspire may take a few seconds to load all of the necessary components.
If you are downloading Aspire Community, ignore the error message about being unable to download the com.accenture:aspire-dcm-enterprise component. The aspire-dcm-enterprise component is available only with Enterprise systems (and is used for Distributed Processing).
aspire-dcm-enterprise THIS ITEM IS BEING DEPRECATED.
In Aspire, every component in the system has its own web page. This is useful for debugging, testing, and manipulating the system through the Aspire Admin Interface.
For this next step, we're going to feed a document through the configured Aspire pipeline and check out the result.
<doc> <fetchUrl>http://www.searchtechnologies.com</fetchUrl> <httpResponse code="200" source="FetchURLStage">OK</httpResponse> <protocol source="FetchURLStage/protocol">http</protocol> <host source="FetchURLStage/host">www.searchtechnologies.com</host> <mimeType source="FetchURLStage/mimeType">text/html</mimeType> <encoding source="FetchURLStage/encoding">utf-8</encoding> <extension source="FetchURLStage"> <field name="status">HTTP/1.1 200 OK</field> <field name="Date">Mon, 07 Mar 2017 03:22:12 GMT</field> <field name="Server">Microsoft-IIS/6.0</field> <field name="Cache-Control">private</field> <field name="Content-Type">text/html; charset=utf-8</field> <field name="Content-Length">12485</field> </extension> <title source="ExtractTextStage/title">Search Technologies: The search engine implementation experts</title> <contentType source="ExtractTextStage/Content-Type">application/xhtml+xml</contentType> <description source="ExtractTextStage/description">We architect, implement and tune leading search engines. Our experts will help your search implementation exceed expectations regardless of which search engine you use</description> <extension source="ExtractTextStage"> <field name="Content-Location">http://www.searchtechnologies.com</field> <field name="Content-Encoding">ISO-8859-1</field> </extension> <content source="ExtractTextStage"><![CDATA[ Home About Us Executive Team Careers Frequently Asked Questions . . . ]]></content> <domainName source="ExtractDomainImpl">searchtechnologies.com</domainName> </doc>
Note the metadata which added to this document from all of the various pipeline stages:
For the final step, we're going to add a Groovy script component to the document processing pipeline to convert the title to ALL CAPS. This will require editing the Aspire system configuration file to add this new component, as well as adding it to the pipeline.
Note that you do not need to shut down Aspire to make this change.
To add the Groovy component, edit the "config/system-example.xml" file in your aspire-quick-start installation directory to include the following component:
<component name="ExtractDomain" subType="default" factoryName="aspire-extract-domain" /> <!-- vvvv ADD THESE LINES BELOW vvv --> <component name="UpperCaseTitle" subType="default" factoryName="aspire-groovy"> <script> <![CDATA[ doc.set("title",doc.getText("title").toUpperCase()); ]]> </script> </component> <!-- ^^^ ADD THE LINES ABOVE ^^^ --> <component name="PrintToFile" subType="printToError" factoryName="aspire-tools"> <outputFile>exampleDebug.out</outputFile> </component>
In the Groovy code above, the "doc" variable is a reference to the document object being processed by the Aspire document processing pipeline. Click Groovy Scripting to learn more about Groovy scripting in general, and AspireObject Class or AspireObject Class to learn more about the Java object which is referenced by the "doc" variable.
Next, be sure to add the new Groovy component to the pipeline:
<pipelines> <pipeline name="doc-process" default="true"> <stages> <stage component="FetchUrl" /> <stage component="ExtractText" /> <stage component="DateChooser" /> <stage component="ExtractDomain" /> <stage component="UpperCaseTitle" /> <!-- ADD THIS LINE HERE --> <stage component="PrintToFile" /> </stages> </pipeline> </pipelines>
Now, go to the Aspire home page (http://localhost:50505/aspire) and click on the "reload" button:
Now go back to FeedOne and try feeding the http://www.searchtechnologies.com link again. Your title should now be in all CAPS, as follows:
You have completed the 20-minute quick start for creating applications.
Next, to see how to build Aspire distributions from scratch using Maven prototypes and Maven component repositories, you should try the Aspire Quick Start with Distribution Archetype.
To shutdown Aspire, go to the home page (http://localhost:50505/aspire) and click on the "Shutdown" link. Or, you could go to the Aspire console window (where you started Aspire with "bin\startup") and type "shutdown" and then press the Return or Enter key. Either way will shut down Aspire.