neo4j-devtools / neo4j-bloom

A public repository for informal docs, problem reporting and content sharing related to Neo4j Bloom.
Apache License 2.0
18 stars 0 forks source link

Search Phrase does not work #5

Closed ThorstenPwC closed 5 months ago

ThorstenPwC commented 6 years ago

When working in neo4j Browser, the following statement returns 1 node.

MATCH (a0 { Id: '10000'})
return a0

The statement above will not return any node when entering directly into the search field. (Error Message: Sorry, we couldn't find any results for this search.)

The same statement will return one node, when I use the Search Phrase and enter the statement in the 'Cypher query' field.

Now I want to use the query dynamically:

Search phrase: Show $id
Cypher query: MATCH (a0 { Id: $id})
return a0

When using this search phrase in the search field/command field, I do not receive any result/node.

irfannuri commented 6 years ago

Hi @ThorstenPwC , thanks for submitting this issue.

When passing parameters to search phrases, it tries to infer the parameter type from the value, hence 10000 is treated as a number. Since it is a string property in db, it does not find any match.

We are planning to provide a way to set the type of parameters in search phrases. Till then you can cast the parameter in your search phrase query, like

MATCH (a0 { Id: toString(toInt($id))})
return a0

in this case.

ckanz commented 5 months ago

Hi @ThorstenPwC, we implemented the ability the specify data types for search phrase parameters by now. You can find more about it in docs here: https://neo4j.com/docs/bloom-user-guide/current/bloom-tutorial/search-phrases-advanced/#_dynamic_search_phrases

I will be closing this issue since it's been some time since the last reply. If you have any issues with Bloom, please feel free to raise a new issue here or on Canny https://neo4j-aura.canny.io/explore

Best regards!