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

  • SEARCH
  • Home
  • 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 8403811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:26:24+00:00 2026-06-09T22:26:24+00:00

I am using Compass to make queries on data inside in memory data structure.

  • 0

I am using Compass to make queries on data inside in memory data structure. It works fine for searching String and enum values, now I want to search dates.

Search criteria are annotated by @SearchRestriction annotation. Example about someDate:

    @SearchRestriction(path="fooBar.someDate" type = SearchRestrictionType.EQUAL)
    String someDate;

At searchable data SomeDate is annotated like the following:

    @SearchableProperty
    Date someDate;

SomeDate inside the searchable data is generated with new Date();) and query String is given as 20120802.

Situation on debugger:
This code generates queries like this:

    someDate:20120802

Here someDate is the name of the field I am looking for and 20120802 is a date in order yyyyMMdd.

Problem:
No results is returned, when this query is run. I get an empty list. The Date in query is the same as in the Date object.

What is wrong??
Is this wrong way to search Dates with Compass? I can find only range queries about Date, but a search with exact Date or part of exact Date I cannot find.

  • 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-09T22:26:26+00:00Added an answer on June 9, 2026 at 10:26 pm

    You need to specify the format for Searchable property [Date]

    @SearchableProperty(format = "yyyyMMdd")
    

    To some extent, it relates to Grails: Lucene, Compass Query Builder and date ranges

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

Sidebar

Related Questions

I'm trying to create application for WP7 using data from compass sensor. I've found
How do I add compass analyzer while indexing and searching data in compass.I am
I am using compass based indexing on my project. My annotation based configuration for
In my Rails 3.2.1 application I am using compass(0.12.alpha.4) to create sprites: @import compass
I'm creating a website and as I am thoroughly enjoying using SASS/Compass for organizing
Using the searchable plugin in Grails (which uses Compass/Lucene under the hood) we're trying
I've create a custom theme using Sencha ExtJS and the compass compile and sencha
Know if it's possible to access the iPhone compass in Safari using JavaScript? I
I've been using compass from http://compass-style.org/ to manage my sites css for a long
I need to map a collection of components with compass (using XML mapping)... Is

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.