Creating Parallel Requests

Creating parallel requests is useful if you have different indexes or if you want to search for specific content in the same index using different queries.

The following use case describes how to proceed if you want your application to fetch hits from two sources using the same query basis:

  • One of these source is a filesystem crawl retrieving data through a Files connector.

    In our example, the set of documents located under the <INSTALLDIR>/docs/ directory.

  • The other one is a web crawl retrieving data through an HTTP connector.

    In our example, the NETVIBES website (http://www.exalead.com/software/).

Our application is configured in the Mashup Builder to use two CloudView Search feeds that will select the 2 most relevant hits for the request on the search results page ${page.params["q"]} to focus on the two specific data sources.

By making a query on the Mashup UI, we see below that the search page displays results coming from the two data sources:

  • one from an NETVIBES website URL
  • another from the filesystem

Example of parallel requests on the Mashup UI

XML configuration example

The following XML Configuration represents how the parallel requests presented above are coded.

<Feed id="page" enable="true" embed="true" className="com.exalead.access.basefeeds.PageFeed">
<Parameters>
<Parameter name="q">${page.params["q"]}</Parameter>
</Parameters>
<SubFeeds>
<Feed id="crawls" enable="true" embed="true" className="com.exalead.access.basefeeds.CloudviewFeed">
<Parameters>
<Parameter name="searchAPIVersion">V6R2015x</Parameter>
<Parameter name="searchapi">{access-api.searchapi.url}/search</Parameter>
<Parameter name="q">source:web ${page.params["q"]}</Parameter>
<Parameter name="defaultQuery">#all</Parameter>
<Parameter name="page">1</Parameter>
<Parameter name="per_page">3</Parameter>
</Parameters>
<Properties>
<Property kind="TITLE" name="TITLE">${entry.metas["title"]}</Property>
</Properties>
</Feed>
<Feed id="files" enable="true" embed="true" className="com.exalead.access.basefeeds.CloudviewFeed">
<Parameters>
<Parameter name="searchAPIVersion">V6R2015x</Parameter>
<Parameter name="searchapi">{access-api.searchapi.url}/search</Parameter>
<Parameter name="q">source:fs ${page.params["q"]}</Parameter>
<Parameter name="defaultQuery">#all</Parameter>
<Parameter name="page">1</Parameter>
<Parameter name="per_page">3</Parameter>
</Parameters>
<Properties>
<Property kind="TITLE" name="TITLE">${entry.metas["filename"]}</Property>
</Properties>
</Feed>
</SubFeeds>
</Feed>