Gravatar for adrian.calvo@eptisati.com

Question by acleptisa, Aug 25, 2017 8:19 AM

Problems filtering metadata date's type

Hi everybody,

I'm having problems filtering dates,

We created the field document_published of type date and do the mapping for this field, but when we add the condition at Rest petiton dont serve any result:

examples:

working:

https://platform.cloud.coveo.com/rest/search?access_token=xxfab3fa39-995b-4014-a390-410c511e0ca3&q=telematica%20individual%20347&cq=@syssource==(%E2%80%9Ca3responde%20sitemap%E2%80%9D)&aq=@application_ag==%2221%22@document_type=%27documentos%27&enableDidYouMean=true&enableThesaurus=true

not working with document_published filter:

https://platform.cloud.coveo.com/rest/search?access_token=xxfab3fa39-995b-4014-a390-410c511e0ca3&q=telematica%20individual%20347&cq=@syssource==(%E2%80%9Ca3responde%20sitemap%E2%80%9D)&aq=@application_ag==%2221%22@document_type=%27documentos%27@document_published=2015/01/01..2017/08/24&enableDidYouMean=true&enableThesaurus=true

I'm not sure if this is the correct way to write the filter but I see in the documentation:

https://onlinehelp.coveo.com/en/cloud/coveo_cloud_query_syntax_reference.htm,

this is how we configured the field:

and how you can see the format of the date and the document_published meta is the same

Can someone help me, filtering document_published meta?

3 Replies
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Aug 25, 2017 11:08 AM

I think you're just missing a space between the filters to act as an implicit AND boolean operator:

@application_ag=="21" @document_type="documentos" @document_published=2015/01/01..2017/08/24

&aq=@application_ag==%2221%22%20@document_type=%22documentos%22%20@document_published=2015/01/01..2017/08/24

Gravatar for adrian.calvo@eptisati.com

Answer by acleptisa, Aug 30, 2017 8:32 AM

Hi to everybody,

I was investigating and I can filter using this:

@document_published>now-1y

@document_published>now-12mo

@document_published>now-365d

But I don't know why the ranges are not working, someone can help me? Please

Gravatar for jfcloutier@coveo.com

Answer by PseudoRandom, Aug 31, 2017 12:21 PM

I tried with the following query, and it works... https://platform.cloud.coveo.com/rest/search?access_token=xxfab3fa39-995b-4014-a390-410c511e0ca3&q=telematica%20individual%20347&cq=@syssource==%28%E2%80%9Ca3responde%20sitemap%E2%80%9D%29&aq=@application_ag==(%2221%22)%20@document_type==(%27documentos%27)%20@date=2000/01/01..2017/08/28&enableDidYouMean=true&enableThesaurus=true

However, when I tried with the following query, It should work but didn't... https://platform.cloud.coveo.com/rest/search?access_token=xxfab3fa39-995b-4014-a390-410c511e0ca3&q=telematica%20individual%20347&cq=@syssource==%28%E2%80%9Ca3responde%20sitemap%E2%80%9D%29&aq=@application_ag==(%2221%22)%20@document_type==(%27documentos%27)%20@document_published=2000/01/01..2017/08/28&enableDidYouMean=true&enableThesaurus=true

So, as it was kind of strange, I created a source in a new org, with 2 fields : documentpublished and document_published. I mapped the field to just copy the document's date. It works with date, with documentpublished, but not document_published. Looks like we have a parsing bug (I created a ticket for it). You can just rename the field to documentpublished and it will be working.

Gravatar for carlos.cenjor@ti.eptisa.com

Comment by carlos.cenjor, Aug 31, 2017 12:25 PM

Thank you very much :)

Ask a question