problem with date search

I've imported some data using CSV import, configured folder to search for specific metadata using Administration -> Local configuration -> Document content configuration , so when filtering date, sometimes it gives results sometimes not. I've attached the document i'm using to import data. Please note that i'm using french date format. Does anyone faced this problem ? Are there a solution ?


This is the code i'm using for search

<contentView name="parent_accuse_de_reception_content">


        <property name="coreSession">#{documentManager}</property>
        <property name="maxResults">DEFAULT_NAVIGATION_RESULTS</property>
        <whereClause docType="accuse_de_reception_search">
          <predicate parameter="adr:num_facture" operator="ILIKE">
            <field schema="accuse_de_reception_search" name="num_facture" />
          <predicate parameter="bcbase:num_bc" operator="ILIKE">
            <field schema="bc_base" name="num_bc" />
          <predicate parameter="adr:date_comptabilisation" operator="=">
            <field schema="accuse_de_reception_search" name="date_comptabilisation" />
          <predicate parameter="adr:date_echeance" operator="=">
            <field schema="accuse_de_reception_search" name="date_echeance" />
          <predicate parameter="adr:client" operator="ILIKE">
            <field schema="accuse_de_reception_search" name="client" />
          <predicate parameter="adr:ville" operator="ILIKE">
            <field schema="accuse_de_reception_search" name="ville" />
          <predicate parameter="adr:montant" operator="=">
            <field schema="accuse_de_reception_search" name="montant" />
          <predicate parameter="adr:code_article" operator="ILIKE">
            <field schema="accuse_de_reception_search" name="code_article" />

                ecm:isCheckedInVersion = 0 AND
                ecm:mixinType != 'HiddenInNavigation' AND 
                ecm:currentLifeCycleState != 'deleted' AND ecm:parentId = ? AND
                ecm:primaryType = 'accuse_de_reception' 
            <sort column="dc:title" ascending="true" />




      <searchLayout name="accuse_de_reception_filter" filterDisplayType="quick" />

        <layout name="accuse_de_reception_listing_ajax" title="document_listing"
          translateTitle="true" iconPath="/icons/document_listing_icon.png"
          showCSVExport="true" showPDFExport="false" showEditColumns="true" 
          showSyndicationLinks="true" />
          <layout iconPath="/icons/document_listing_icon_2_columns_icon.png" 
          name="document_listing_thumbnail" showEditRows="true" 
          showSpreadsheet="true" title="document_thumbnail_listing" 
          translateTitle="true" />

      <actions category="CURRENT_SELECTION_LIST" />
FILES:   csv-09-09.csv
0 votes

1 answers



You create documents using the CSV import, then you try filtering them. When it does not work, have your created documents the right date for the “adr:date_comptabilisation” and/or “adr:date_echeance” metadata? Also, looking at this page:, I see that the dates columns do have quotes, whereas your example doesn't have quotes surrounding the dates. BUT the page does not use the French date format. So as you have csv, can you create/generate it with another date format?

If you can't, I guess you use the CSV Importer nearly the way it is used here:

I see this at lines 93-96:

CSVImporterOptions options = CSVImporterOptions.DEFAULT_OPTIONS; TransactionHelper.commitOrRollbackTransaction(); String importId = csvImporter.launchImport(session, "/", getCSVFile(DOCS_OK_CSV), DOCS_OK_CSV, options);

In the CSVImporterOptions class (, there is a “dateFormat” attribute. Maybe you can create your own options class with the right dateFormat (“dd/MM/yyyy”)?

I hope this helps.

0 votes

Greg Drayon Thank you for reply, yes my created documents do have the right date since i've already changed dateFormat to (“dd/MM/yyyy”) in , i've also tried adding quotes but still having the same problem. In the example above i'm getting result for "31/08/2015" and "11/06/2015" but not for "30/06/2015"

Maybe the problem doesn't come from the CSVImporter. If I get it right, you have some kind of folder (which may or may not contain any document, it does not matter) with a contentView to display the result of a query? Can you give the query set up in the contentView, or run this query in the NXQL Search (for admin only)? Does it brings you the right results?

Greg Drayon please can you see my update ? When running this query

SELECT * FROM accuse_de_reception WHERE adr:date_comptabilisation = DATE &apos;2015-06-30&apos; and ecm:mixinType != &apos;HiddenInNavigation&apos; AND ecm:isProxy = 0 AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != &apos;deleted&apos;

i could get the result


The query you run seems different from the one run by the contentView. I would enable the logs for the ``` org.nuxeo.ecm.core.query

category, in the log4j.xml file, to see what is exactly the query run by the contentView. It should appear at the end of the server.log file when you access the folder using the contentView.