query = "name:*#{params[:term]}* OR name2:*#{params[:term]}*"
get '/search' do content_type :json neo = Neography::Rest.new cypher = "START me=node:node_index({query}) RETURN ID(me), me.name ORDER BY me.name LIMIT 15" query = "permalink:*#{params[:term]}* OR name:*#{params[:term]}*" neo.execute_query(cypher, {:query => query })["data"]. map{|x| { label: x[1], value: x[0] } }.to_json end
I'm working on a site that uses Neo4j through a php library. The thing that bothers me is that my suggestions show up quite slowly ( 1-3 seconds ). They should appear almoast instantaneously. I am using Jquery ui Autocomplete for showing results, and the following cypher query:
$query = "START n = node:Destination('name:*')
WHERE ( n.name =~ '(?i).*".$input.".*' OR n.name2 =~ '(?i).*".$input.".*' ) AND has( n.published )
RETURN n
LIMIT 6";Does anyone have any optimization ideas, or can someone tell me what am i doing wrong?
--
--