Oh, and another thing to note:  ML7 has support for suggestions out of the box 
(new endpoint).

________________________________
From: [email protected] 
[[email protected]] on behalf of Timothy W. Cook 
[[email protected]]
Sent: Thursday, December 12, 2013 8:25 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Lifting a portion of App Builder app to 
use in a different place

I don't really have an answer to your question.  However, you might find the 
answer in how Roxy operates.  I have played with it a bit and it interacts with 
App Builder (at least the REST API).
https://github.com/marklogic/roxy

HTH,
Tim





On Thu, Dec 12, 2013 at 2:12 PM, Steiner, David J. (LNG-DAY) 
<[email protected]<mailto:[email protected]>> wrote:
I built an app using App Builder and I also have a separate app that I built by 
just using xquery, html, jquery javascript, etc….

The separate app operates on a database that is different from the one that the 
App Builder app operates on.  However, I’d like to incorporate the “search 
suggestion” of the App Builder app in my separate app.

I found the code for the suggestion in “search.js”.

I see that there is an endpoint in it for the search suggestion: 
/v1/resources/extsuggest" + '?rs:pqtxt='

Ideally, I guess, I’d like to be able to incorporate the appropriate HTML, 
javascript and css in my separate app, add the 
http://host:port/<UrlBlockedError.aspx> to the front of the endpoint and have 
the suggestion just work.

Has anyone ever attempted this?

I can also write a service that would replicate what the suggestion endpoint is 
doing, but I’d rather not if I don’t have to, so if anyone has any experience 
in doing this, I’d appreciate the guidance.  By the way, I started the service 
and I’m sure that it’ll have to do something different since it appears that 
there are extra backslashes and quotes that need to be inserted to make it good 
json (I noticed this by looking at the difference between my output and the 
output of the app builder extension?

I’ve already gotten this far in my test page, which I’ve created just to see if 
I can get the suggestion to work.  I tried sticking the fully qualified 
location in the suggestEndpoint variable (i.e., adding 
http://host:port<UrlBlockedError.aspx> to the front of the url) in search.js 
and nothing really happened, so I’m assuming that perhaps there’s configuration 
stuff that I’m skipping, or possibly a wide variety of things that are missing…

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Title</title>
  <link rel="stylesheet" 
href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css";>
  <link type="text/css" rel="stylesheet" 
href="application/lib/viz/search/search.css" media="screen, print"/>
  <script src="http://code.jquery.com/jquery-1.9.1.min.js";></script>
  <script 
src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js";></script>
  <script src="application/lib/viz/search/search.js" 
type="text/javascript"></script>
</head>
<body>
<div data-role="page" data-theme="d" id="myPage">
        <div data-role="header">
                <h1>Header.</h1>
        </div>
        <div class="content-primary">
           <div id="search" class="search widget"></div>
        </div>
        <div class="content-secondary">
        </div>
</div>
</body>
<script>
var search = ML.createSearch("search");
</script>
</html>

Thanks for any help,
David

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general




--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to