Search API - External Integration

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets

Search API - External Integration

Postby quali on Wed Mar 18, 2015 7:36 am

Hello All,
Is there anyone out there who ever integrated with Flare search to display its search results inside his/her own application?
We have a web application where we would like to display a search box and once user is searching for something we want to display results from different sources where Flare is one of it:

[Search Box]
- Documentation (Flare package)
- result 1 - bla bla
- result 2 - bla bla
- result 3 - bla bla
- Technical videos
- video 1
- video 2
- Forum entries
- Topic 1
- Topic 2
- Topic 3
- Topic 4

So we're looking for a way to send some ajax request to Flare webhelp and get json or some result that we can parse and display in our own html component.

Will appreciate any help you can offer!

Thanks in advance,
Liron
quali
Jr. Propeller Head
 
Posts: 3
Joined: Wed Mar 18, 2015 7:30 am

Re: Search API - External Integration

Postby Dave Lee on Wed Mar 18, 2015 8:52 am

I don't think the Flare output has an API - or at least I've never heard of it.

New in Flare v11, you can choose where the search results are displayed, by using the search results skin component (to style the results) and search results proxy (to position the results in a topic). However, I'm not aware of how you would get the actual raw data, so you can integrate it in a different search mechanism.

Anyway, I'd be interested if you make any progress with this - it's probably something I will need to do in the future.
Dave Lee
Master Propellus Maximus
 
Posts: 5676
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Search API - External Integration

Postby Paulie on Wed Mar 18, 2015 1:13 pm

Hi there,

I managed to replicate something like you are asking for a couple of years ago, but I would have to have a think about how I actually did it, as it was a proof of concept for my old company. I think, from memory, that I passed a search query into the HTML5 WebHelp using the URL parameters, then displayed the search results in a WebBrowser control.

I'll have a think about it and see if I can shed any more light.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Paulie
Sr. Propeller Head
 
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Search API - External Integration

Postby quali on Sat Mar 21, 2015 11:24 pm

Thanks for replying guys!
Paulie, i'll appreciate if you could try to remember what was your solution. As I understand what you did is kind of displaying the html result in a kind of an "iframe" (in a web application) which will limit my abilities to modify the result and customize it.

Maybe I can get an html result from flare search url and extract the desired DOM element but it sounds like the worse method I can think of.

Liron
quali
Jr. Propeller Head
 
Posts: 3
Joined: Wed Mar 18, 2015 7:30 am

Re: Search API - External Integration

Postby Paulie on Sun Mar 22, 2015 12:30 pm

Hi there,

I had a bit of a play on the weekend and was able to get the search results using the following approach(note that this was for a Windows application, rather than a web app):

I had a hidden WebBrowser control that I passed in the search URL:
Code: Select all
<YourPath>/Default.htm#search-<YourSearchQuery>

Once the document was loaded, I found the <ul> element with the id attribute value of "resultList". This element contains all of the search information and looks something like this:
Code: Select all
<ul id="resultList"><li><h3 class="title"><a href="#Tech Writing Procedures/Automated Builds.htm?Highlight=Automated Build"><b>Automated</b> <b>Build</b>s</a></h3><div class="description">The technical documentation is automatically built and published each night at 5 pm. Overview of the <b>Build</b> Process The overnight <b>build</b> currently performs the following tasks: Author-it documents are built. Flare documents are built. The documents are uploaded to Overnight<b>Build</b> folder. The document ...</div><div class="url"><cite>Tech Writing Procedures/Automated Builds.htm</cite></div></li>
</ul>

There is one <li> child element per search result. This contains the following child elements:
<h3> - The title and URL for the topic (I think this is what you need)
<div> - The meta description or the first paragraph of the topic if no meta description has been set.

From there, it was simply a case of iterating through each <li> child element and extracting the required information.

At this point I should probably point out that I am a Technical Writer that does a bit of development work on the side. Being a self-taught coder, there is probably a more elegant way to extract this information that I am not aware of. However, the above does work, so at least there is one option.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Paulie
Sr. Propeller Head
 
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Search API - External Integration

Postby quali on Mon Mar 23, 2015 12:57 am

Looks great, Thanks!
I wish for a better API than manually parsing of the result html..

I'll try your approach, it looks promising.
Liron
quali
Jr. Propeller Head
 
Posts: 3
Joined: Wed Mar 18, 2015 7:30 am

Re: Search API - External Integration

Postby atjohnson on Thu May 23, 2019 8:52 am

Hi,
This topic is a few years old, but I was wondering if anyone found a solution or if something new has been added to Flare in the past few years...

My interest is basically the same as the original poster - can we use some kind of API, or something else, to connect an internal search tool to a Flare output?
The internal search tool is connected to different applications so staff have one tool to search. This internal search is connected to our our main product applications so support can find client accounts, Salesforce for contract/account details, and a knowledge base we've been using (that I want to replace with Flare).

I've been looking around online for possible solutions, but I am not very technical so I don't really know if I've been looking in the right direction. This post is the only thing I've seen where it looks like someone else has a similar need.

Thanks for any help/advice,
Amy
atjohnson
Jr. Propeller Head
 
Posts: 3
Joined: Fri Mar 24, 2017 5:32 am

Re: Search API - External Integration

Postby Michelle_Gardner on Fri May 31, 2019 7:13 am

atjohnson wrote:Hi,
This topic is a few years old, but I was wondering if anyone found a solution or if something new has been added to Flare in the past few years...

My interest is basically the same as the original poster - can we use some kind of API, or something else, to connect an internal search tool to a Flare output?
The internal search tool is connected to different applications so staff have one tool to search. This internal search is connected to our our main product applications so support can find client accounts, Salesforce for contract/account details, and a knowledge base we've been using (that I want to replace with Flare).


My team is interested in this, too. When I asked a similar question of Jennifer Morse, she thought there may be a way to achieve this with a 3rd party site search tool, like cludo.com or swiftype. In her reply, she said she's never done it, but you can swap out Flare’s search with one of these 3rd party tools. They all may work a little different, but you may be able to have this search tool index other pages in other eco systems, so that it can search and retrieve files from other sites.
Michelle_Gardner
Propeller Head
 
Posts: 21
Joined: Mon Apr 14, 2014 10:22 am

Re: Search API - External Integration

Postby Dave Lee on Fri May 31, 2019 7:59 am

I think the question is probably more down to what your 3rd party search tool supports, so maybe ask the people who develop it.

You'd presumably be able to use your search engine if:
- It can browse Flare's HTML output and build its own index
- You can run the search from a web page (i.e. how you'd run it from a web page is the same as how you'd do it in Flare).

Obviously your search engine isn't going to be connected to the search control in Flare's skins, but you could switch off the search control in the skin, and just use your own control instead. You should also be able to place your search control in the header with a small bit of scripting.

It's also not going to recognise MadCap search features like search filters and synonyms, but neither do the "integrated" alternatives like Elasticsearch and Google.
Dave Lee
Master Propellus Maximus
 
Posts: 5676
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: Search API - External Integration

Postby Michelle_Gardner on Fri May 31, 2019 8:25 am

Thanks for your insight, David. I'll share this information with my team.
Michelle_Gardner
Propeller Head
 
Posts: 21
Joined: Mon Apr 14, 2014 10:22 am


Return to Web-based Outputs

Who is online

Users browsing this forum: No registered users and 4 guests