lucene query builder Q() not working #67

Closed
McPedr0 opened this Issue Jun 4, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@McPedr0

McPedr0 commented Jun 4, 2012

I wasn't sure it was a bug, so I asked the question here:
http://stackoverflow.com/questions/10857888/lucene-query-building-in-neo4jrestclient

Here is the REST traffic, let me know if I am missing something.

E@@2J'uO
:+:+HTTP/1.1 200 OK
Content-Length: 794
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Connection: close
Server: Jetty(6.1.25)

{
"cypher" : "http://localhost:7474/db/data/cypher",
"relationship_index" : "http://localhost:7474/db/data/index/relationship",
"node" : "http://localhost:7474/db/data/node",
"relationship_types" : "http://localhost:7474/db/data/relationship/types",
"neo4j_version" : "1.7",
"batch" : "http://localhost:7474/db/data/batch",
"extensions_info" : "http://localhost:7474/db/data/ext",
"node_index" : "http://localhost:7474/db/data/index/node",
"reference_node" : "http://localhost:7474/db/data/node/0",
"extensions" : {
"CypherPlugin" : {
"execute_query" : "http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query"
},
"GremlinPlugin" : {
"execute_script" : "http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script"
}
}
}


EOb@@yd22j+D
:,:,HTTP/1.1 200 OK
Content-Length: 368
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Connection: close
Server: Jetty(6.1.25)

{
"index1" : {
"to_lower_case" : "true",
"template" : "http://localhost:7474/db/data/index/node/index1/{key}/{value}",
"provider" : "lucene",
"type" : "fulltext"
},
"index2" : {
"to_lower_case" : "true",
"template" : "http://localhost:7474/db/data/index/node/index2/{key}/{value}",
"provider" : "lucene",
"type" : "fulltext"
}
}


EC@@n2pzll7
:4:4GET /db/data/index/node/index2/text?query=playerId%3A%28%5C%2A%29 HTTP/1.1
Host: localhost:7474
Content-Length: 2
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
connection: close
accept-encoding: *
accept: application/json
user-agent: Neo4jPythonClient/1.7.0

{}

@versae

This comment has been minimized.

Show comment
Hide comment
@versae

versae Jun 4, 2012

Owner

I'm not sure that is an issue on neo4j-rest-client than the lucene-querybuilder. Anyway, you can try using the param wildcard like:

from neo4jrestclient.client import GraphDatabase, Q
db = GraphDatabase("http://localhost:7474/db/data")
userIndex = db.nodes.indexes.get("index2")
print userIndex.query(Q('username', "*", wildcard=True))[:]
Owner

versae commented Jun 4, 2012

I'm not sure that is an issue on neo4j-rest-client than the lucene-querybuilder. Anyway, you can try using the param wildcard like:

from neo4jrestclient.client import GraphDatabase, Q
db = GraphDatabase("http://localhost:7474/db/data")
userIndex = db.nodes.indexes.get("index2")
print userIndex.query(Q('username', "*", wildcard=True))[:]
@mhluongo

This comment has been minimized.

Show comment
Hide comment
@mhluongo

mhluongo Jun 5, 2012

Contributor

@yardyar this should be filed on lucene-querybuilder I think... https://github.com/scholrly/lucene-querybuilder/

Contributor

mhluongo commented Jun 5, 2012

@yardyar this should be filed on lucene-querybuilder I think... https://github.com/scholrly/lucene-querybuilder/

@mhluongo

This comment has been minimized.

Show comment
Hide comment
@mhluongo

mhluongo Jun 5, 2012

Contributor

Actually, disregard that- @versae is absolutely right. "*" is usually escaped, unless you include wildcard=True.

Contributor

mhluongo commented Jun 5, 2012

Actually, disregard that- @versae is absolutely right. "*" is usually escaped, unless you include wildcard=True.

@versae versae closed this Jun 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment