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/ 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 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]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to