Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:29:38+00:00 2026-06-07T15:29:38+00:00

Is there a way to search a manual index in Neo4j using a numeric

  • 0

Is there a way to search a manual index in Neo4j using a numeric comparison operator(>=, <=, <, >, …)? Looking at the Gremlin index examples, they all tend to present a search with a specific property value.

Say I have around 10M relationships of two types which both have numeric value in a property called ‘property’, in the first double, in the second int.

gremlin> g.e(123).getProperty('property')
==> 1.57479276459179

Now, if I knew the exact property value, which is a log-based pvalue of type double, I could easily locate the node with

gremlin> g.idx('index_e_ASSOC').get('property', 1.57479276459179)
==> e[2421730][31493-ASSOCIATION->53378]
==> e[4885094][53378-ASSOCIATION->31493]
==> e[866409][37891-ASSOCIATION->6292]
==> e[123][6292-ASSOCIATION->37891]

Instead I want to do a range search for the ‘property’, so for example find all edges in which ‘property’ >= 0 && ‘property’ <= 1.6. Is this something that could be done with Gremlin? Looking at Gremlin users discussion group tells me that even the wildcard search from a fulltext Lucene index is a bit of hack, and Neo4j API doesn’t help.

Edit: Found another question like this in Stackoverflow (titled “Range queries in Neo4j using Lucene query syntax”; new users can only post a maximum of two hyperlinks) which lead to Neo4j documentation. I recreated the index by using ValueContext for numeric values. By following an example found in neo4j discussion group (title: combine numericRange query with relationship query) I can do a query like

start a=node(123)
match a-[rel]-(b)
where type(rel) = "ASSOCIATION" AND rel.`property` > 1.0 AND rel.`property` < 2.0
RETURN b
LIMIT 20;

which uses the range search. What’s the syntax for Gremlin? It should be something like

g.idx('index_e_ASSOC')[[property: Neo4jTokens.QUERY_HEADER + "[1.0 TO 2.0]"]].count()

Which is syntactically correct, but count yields 0 results even though there are edges with property within that range.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:29:41+00:00Added an answer on June 7, 2026 at 3:29 pm

    You can use the Gremlin filter step on all the edges, but this does a table scan:

    g.E.filter{it.property >= 0 && it.property <= 1.6}
    

    See https://github.com/tinkerpop/gremlin/wiki/Gremlin-Steps

    If index index_e_ASSOC contains a subset of all the edges, you could use a wildcard query to narrow the range:

    start = g.idx('index_e_ASSOC')[['property': Neo4jTokens.QUERY_HEADER + "*"]]
    start.filter{it.property >= 0 && it.property <= 1.6}
    

    Note that Neo4jTokens.QUERY_HEADER resolves to "%query%" so you could also write it like this:

    start = g.idx('index_e_ASSOC')[['property': "%query%" + "*"]]
    start.filter{it.property >= 0 && it.property <= 1.6}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a way to search and replace a string using single unix command
Is there a way to search a certain user's outlook inbox to get all
Is there a way to search for a string within all stored procs in
Is there a way to search a project for all uses of some text,
Is there any way to search playlists on youtube using gdata-python-client? As for documentation
Is there any way to search messages on IMAP server, using imap_search function. According
Is there a way to search on www.qantas.com.au or other sites that don't use
Is there a way to search for a file in a subversion repository? Something
Is there a way to search and eventually search and replace text in Visual
Is there a way to search, from a string, a line containing another string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.