I access fulltext index by the findAllByQuery() repository method, it works fine, but i cannot pass pagination params, so i'm trying Cypher query which can use LIMIT, below are my testings:
Case 1 - Works fine but hardcoding
@Query( "START n=node:searchName('name:*test*') return n" )
EndResult<SomeGraphObject> findByName()
Case 2(Never work), give term = "*test*", throw exception
@Query( "START n=node:searchName('name:{0}') return n" )
EndResult<SomeGraphObject> findByName(String term)
Case 3(Partially working) - Works fine when give luceneExpression = "name:*test*", but doesn't work when give luceneExpression = "name:*test test*", i mean doesn't work when query string include space.
@Query( "START n=node:searchName({0}) return n" )
EndResult<SomeGraphObject> findByName(String luceneExpression)
Another issue is when i use findAllByQuery() repository method, index searchName will be created when first time create or query. But when i use Cypher query without creating index searchName, it will throw "Index searchName does not exist" error.
Any help will be greatly appreciated.
SomeGraphObject.java
@NodeEntity
public class SomeGraphObject {
@GraphId Long id;
@Indexed(indexName="searchName", indexType = IndexType.FULLTEXT)
String name;
}