Spring Data Neo4j
  1. Spring Data Neo4j
  2. DATAGRAPH-117

RestIndex creates bad queries for findByPropertyValue requests

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 1.1
    • Fix Version/s: 2.0.RC1
    • Component/s: CORE
    • Labels:
    • Environment:
      Mac OS X, 1.1.RELEASE version of Spring Data Graph

      Description

      I have a fulltext index called nodefull.

      I have a NodeEntity of type Example with a property called name:

      @NodeEntity
      public class Example {
      @Indexed(indexname = "nodefull", fulltext = true)
      private String name;
      }

      I'm using a repository to query the data over the REST API:

      @Repository
      public interface ExampleRepository extends GraphRepository<Example>, NamedIndexRepository<Example> {
      }

      I'm using the findByPropertyValue() method on the repository:

      exampleRepository.findByPropertyValue("nodefull", "name", "Some value");

      The RESTful query that gets generated is:

      index/node/nodefull/name?query=Some%20Value

      This is not a valid REST API call as far as I can tell, and is returning null results.

      The correct query would be either:

      index/node/nodefull/name/Some%20Value

      or

      index/node/nodefull?query=name:Some%20Value

      as far as I can tell.

      The bug appears to be in the org.springframework.data.neo4j.rest.index.RestIndex class and its public IndexHits<T> query( String key, Object value ) method (first two lines).

        Activity

        Hide
        Michael Hunger added a comment -

        Should work with the change of the Neo4j-REST API that uses a body-payload to query the index.

        Show
        Michael Hunger added a comment - Should work with the change of the Neo4j-REST API that uses a body-payload to query the index.

          People

          • Assignee:
            Michael Hunger
            Reporter:
            Tero Paananen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: