Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Getting Neo4j cypher queries to work in java GraphRepository

  1. #11
    Join Date
    Oct 2012
    Location
    Madrid, ES
    Posts
    5

    Default

    Quote Originally Posted by pedro.abalo View Post
    I need the same thing, how I can change my approach to the problem?, This remains unresolved: (

    thank you very much
    Solved with lucene index in START clause and remove WHERE clause
    Last edited by pedro.abalo; Jan 3rd, 2013 at 10:29 AM.

  2. #12
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Which version of SDN / Neo4j are you using Pedro?

  3. #13
    Join Date
    Oct 2012
    Location
    Madrid, ES
    Posts
    5

    Default

    Quote Originally Posted by MichaelHunger View Post
    Which version of SDN / Neo4j are you using Pedro?
    Spring data Neo4j 2.0.1 release with their respective dependencies maven, I think Neo4j 1.8 and to cypher-dsl version 1.7

    but i solved changing where by index lucene in start clause

    Thanks Michael!

  4. #14
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    What is your query ?

  5. #15
    Join Date
    Oct 2012
    Location
    Madrid, ES
    Posts
    5

    Default

    Quote Originally Posted by MichaelHunger View Post
    What is your query ?
    It's similar to this, i don't remember exact code now

    START user=node:auto_index_node(idUser={0})
    MATCH user-[rel]-car
    WHERE car.model =~ {1} or car.color =~{2}
    RETURN distinct(car)

    where params {1} and {2} is a concated string with "*.termSearch*." (solution previous post)

    the new query it's similar to this:

    START user=node:auto_index_node(idUser={0}), car=node:index_car({1})
    MATCH user-[rel]-car
    RETURN distinct(car)

    where param {1} is concated string with "model: termSearch* color: termSearch*"

    in entityclass i have the index_car fulltext for my fields.

    sorry for my english

    thank Michael

  6. #16
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Is your index really called auto_index_node? The default name is "User" if it is in the user class.

    Also your regexp is wrong:

    "*.termSearch*." must be ".*termSearch.*" dot-star, dot stands for any character and star for zero to n occurrences.

  7. #17
    Join Date
    Oct 2012
    Location
    Madrid, ES
    Posts
    5

    Default

    Quote Originally Posted by MichaelHunger View Post
    Is your index really called auto_index_node? The default name is "User" if it is in the user class.

    Also your regexp is wrong:

    "*.termSearch*." must be ".*termSearch.*" dot-star, dot stands for any character and star for zero to n occurrences.
    Pedro dixit: It's similar to this, i don't remember exact code now

    this was an example, no exact code, intended as pseudo-code. Both consultants work fine in webadmin, but the first example no work fine in SDN.

    Pseudo-code

    START user=node:index(idUser={0})
    MATCH user-[rel]-car
    WHERE car.model =~ {1} or car.color =~{2}
    RETURN distinct(car)

    where params {1} and {2} is a concated string with termSearch and regular expressions (solution previous post)

    the new query it's similar to this:

    START user=node:index_user(idUser={0}), car=node:index_car({1})
    MATCH user-[rel]-car
    RETURN distinct(car)


    where param {1} is a concated string with lucene fields on index_car (lucene) and regular exprression

    Regards
    Last edited by pedro.abalo; Jan 8th, 2013 at 03:38 AM.

  8. #18
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Pedro,

    what does your repository method look like (I assume you use an repository for the query).
    Would it be possible for you to share a project with a failing unit test that shows the problem?

    Thanks a lot

    Michael

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •