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 8905325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:22:05+00:00 2026-06-15T02:22:05+00:00

I have a common entity class: @NodeEntity public class Entity { /*** Common Fields

  • 0

I have a common entity class:

@NodeEntity
public class Entity {
    /*** Common Fields ***/
    @GraphId
    protected Long nodeId;

    @Indexed(level = Indexed.Level.INSTANCE)
    protected Long id;

    @Indexed(level = Indexed.Level.INSTANCE)
    protected String someProperty;        

    ...
}

An Employee class extending Entiy class:

public class Employee extends Entity {

    @Indexed
    private String someOtherProperty;

    ...
}    

I have noticed in my tests that:

@Autowired private GraphDatabaseService service;
Node node1 = service.index().forNodes("Employee").get("id", 1l).getSingle();

does not return any value, while

Node node2 = service.index().forNodes("Employee").get("someProperty", "someValue").getSingle();        
Node node3 = service.index().forNodes("Employee").get("someOtherProperty", "someOtherValue").getSingle();             

both returns as expected.

I tried changing the name of “id” to some other literal and both searching with 1 (numeric) and with “1” (String) but it’s still the same case. I suspect it has something to do with numeric values.

So I wonder maybe I’m using @Indexed in a wrong fashion?

Using:
neo4j-version: 1.8
spring-data-neo4j.version: 2.1.0.RC4

  • 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-15T02:22:06+00:00Added an answer on June 15, 2026 at 2:22 am

    Indexing of numeric fields defaults to numeric values which are then stored in lucene differently, that means one has to use NumericRangeQuery, this is done internally in the Neo4jTemplate.lookupmethod.

    If you don’t want to index the data numerically use @Indexed(numeric=false). Then it is indexed as a String and found by cypher and string index lookups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an abstract class that looks as follows. public abstract class Entity<PK extends
In application I have a bunch of entity class NHibernate mappings with two common
I have a base class called Entity: public class Entity { public int Id
I have a common resource, which I want 1 and only 1 instance of
What I'm attempting to do is have a Super entity class for saved products.
All of my tables have common audit fields: modifiedBy,modifiedDateTime, etc. I would like to
Do you have a common base class for Hibernate entities, i.e. a MappedSuperclass with
I am trying to serialize entities for mobile digest. I have this Entity class:
I have an entity ArticlePattern , which has a property pattern (string). I need
I have two classes: News : /** @Entity @Table(name=news) */ class News { /**

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.