Announcement Announcement Module
Collapse
No announcement yet.
Start item=node(*) doesn't seem to work in SDN Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Start item=node(*) doesn't seem to work in SDN

    Code:
    @Query("START item=node(*) " +
                "return item " +
                "where item.description =~ /.*{0}.*/")
    public Page<Item> search(String description, Pageable page);
    So I am still trying to get my "like" query to work and unfortunately had to see if I could figure out regex in a where clause. Anyway, looking at the Neo4J Cypher query language documentation, they had in the start portion that you could do

    "START n=node(*)
    RETURN n"

    Because you don't have an id for the start node, because there isn't one.

    But when I try that in SDN I get

    Code:
    SEVERE: Servlet.service() for servlet [eventgate] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START item=node(*) return item where item.description =~ /.*{0}.*/ skip 0 limit 100; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement START item=node(*) return item where item.description =~ /.*{0}.*/ skip 0 limit 100; nested exception is expected graph entity id
    "START item=node(*) return item where item.description =~ /.*{0}.*/ skip 0 limit 100"
                     ^] with root cause
    expected graph entity id
    "START item=node(*) return item where item.description =~ /.*{0}.*/ skip 0 limit 100"
    Saying that it requires an id. (*) has to be supported. And yes, I could try to make this an index query with the description in the START portion, but I have tried it before that way and still couldn't get that to work either.

    Thanks for your help.

    Mark

  • #2
    Which version of neo are you using? The node(*) was introduced somewhere in 1.7 I think.

    Also your Regexp won't work, you have to provide the whole regexp (without the slashes) as parameter string.

    Comment


    • #3
      <neo4j.version>1.7.2</neo4j.version>
      <spring-data-neo4j.version>2.1.0.RC1</spring-data-neo4j.version>
      <spring-data-commons.version>1.3.1.RELEASE</spring-data-commons.version>

      My vars in my pom file.

      And disregard the regex. I tried without it. I actually hate regex and avoid it all the time. It was just another try at something because the (*).

      Meanwhile, I have another solution that seems to be working for this query. I had to keep fiddling with the index and finally got Lucene to do it right.

      Thanks Michael

      Mark

      Comment

      Working...
      X