title: How to Send a Javascript Variable to a Grails Controller to Query Neo4J
body: <p>I'm a newbie trying to find uses for Neo4J on Grails.</p>
  
  <p>Basically, I've made 20 grocery item nodes through the Neo4J browser and I want to create a simple Grails site that will let users search a grocery item and visually show the items related to it.   </p>
  
  <p>My index.gsp has:</p>
  
  <pre><code>&lt;input id="item" /&gt;
  </code></pre>
  
  <p>My viz.js has:</p>
  
  <pre><code>$('#item').keyup(function() {
  var item = $('#item').val();
  </code></pre>
  
  <p>My Item Domain class has</p>
  
  <pre><code>class Item {
  static mapWith = "neo4j"
  String name
  </code></pre>
  
  <p>My ItemController class has:</p>
  
  <pre><code>def index() {
  def item = Item.list() [item:item] //No idea, just trying out whatever i find :( 
  </code></pre>
  
  <p>and a query with something like:</p>
  
  <pre><code>def query = Item.cypherStatic ("""start n=node({Item}) match (n)-[r]-&gt;(x) where r='partner' return n, x)
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>How can I properly send the JS 'item' variable into the ItemController?</li>
  <li>How can I use the 'item' variable to properly query the node names which have a 'partner' relationship with the item? </li>
  </ol>