Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get dateRange to work #8

Closed
rbjarnason opened this issue Mar 6, 2016 · 2 comments
Closed

Can't get dateRange to work #8

rbjarnason opened this issue Mar 6, 2016 · 2 comments

Comments

@rbjarnason
Copy link

I have great recommendations coming through and fields with biases work as expected in queries, but I can't get dateRange to work. Any hints would be welcome.

Here is my query - it works fine if I skip the dateRange. I've also tried using the date as name for the dateRange but nothing works I always get 0 results back:

{
  user: user.id,
  fields: [
    {
      name: "domain",
      values: [1],
      bias: -1
    },
    {
      name: "status",
      values: ["published"],
      bias: -1
    }
  ],
  dateRange: {
    name: "availableDate",
    before: "2016-02-15T23:04:45.000Z",
    after: "2012-02-15T23:04:45.000Z"
  }
}

Here is an example from getEvents()

{
    eventId: 'ABuJ1tICnBCr697Y1ZFozAAAATzgGkrIoqAO6pn0kWA',
    event: '$set',
    entityType: 'item',
    entityId: '2919',
    properties: 
     { community: [Object],
       availableDate: '2013-02-15T23:04:45.000Z',
       domain: [Object],
       groupAccess: [Object],
       date: '2013-02-15T23:04:45.000Z',
       status: [Object],
       expireDate: '3016-04-01T04:20:00.000Z',
       communityAccess: [Object],
       official_status: [Object],
       category: [Object],
       group: [Object] },
    eventTime: '2013-02-15T23:04:45.000Z',
    creationTime: '2016-03-05T13:06:13.012Z'
},
@pferrel
Copy link

pferrel commented Mar 6, 2016

You are using both modes of data queries and the available/expire will take precedence since they work without anything in the query. First decide which one of the mode you want and remove config to the unneeded one from engne.json.

https://github.com/actionml/template-scala-parallel-universal-recommendation/tree/v0.3.0#dates

In the mode of date queries where the range is in the query as you are using--#2 in the list--you expect there to be a named property in all items that contain a date, which must be between the dates in the data range.

You must specify this as "dateName": "dateFieldName" in engine.json as described here: https://github.com/actionml/template-scala-parallel-universal-recommendation/tree/v0.3.0#complete-parameter-set.

@pferrel pferrel closed this as completed Mar 6, 2016
@rbjarnason
Copy link
Author

Thanks again @pferrel everything is works now :)

pferrel added a commit that referenced this issue Mar 30, 2016
Fix lingering SparkContext issue, by not implementing PersistentModel…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants