Is there a way to direct Craft to include entry.postDate in the search? I'm using a simple query to search entries.

{% set entries = craft.entries.section('mySection').search('*' ~ query ~ '*').limit(null) %}
  • 1
    How do you want the search to work, exactly? The postDate is stored as a datetime field, you won't be able to search that with text-based search (something like July 12th won't be a datetime even if the timestamp matches that date). You'd need to parse the search string to look for dates, and then search for a range based on that.
    – MoritzLost
    May 26 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.