I wonder how can i build a Cypher query that will combine Fulltext and Simple indexes using spring data neo4j. Consider the following node entity:
@NodeEntity
public class SomeObject {
public SomeObject() {
}
public SomeObject(String name, int height) {
this.name = name;
this.height = height;
}
@Indexed(indexType = IndexType.FULLTEXT, indexName = "search_name")
String name;
@Indexed(numeric = false)
int height;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
OK, so my question is how can i run a query (By using a SomeObject
Graph Repository) that will start from SomeObject
nodes, by referencing their simple indexes and full-text indexes in the same query. For example i would like to write something like that:
START n=node:SomeObject('name: Roy AND height: [170 TO 190]') RETURN n
I know that i cannot write it exactly like that, because spring data neo4j forces me to give a seperate index name for fields that are needed to be FULLTEXT indexed. But what if i need make an index lookup for my SomeObject
entity which combines both fileds? (name & height)
What are the best practices in such case? Is there a way to combine them both in the same query? or maybe should i query each of them separably, and then to perform some some kind of intersection between the two results, so i will get exactly the nodes the meet my original query lookup condition? (name: Roy AND height: [170 TO 190]
).
Thanks! Roy.