pferrel / template-scala-parallel-universal-recommendation

39 stars 89 forks source link

R4sn4 patch1 #20

Open r4sn4 opened 7 years ago

r4sn4 commented 7 years ago

Generalized numeric Range filter -

Following filter limits can be specified -

  1. greaterThan = i, lessThan = j
  2. greaterThan = i, lessThanOrEqual = j
  3. greaterThanOrEqual = i, lessThanOrEqual = j
  4. greaterThanOrEqual = i, lessThan = j
  5. greatherThan = i
  6. lessThan = i
  7. greaterThanOrEqual = i
  8. lessThanOrEqual = i

Filter range is specified in query like this -

curl -H "Content-Type:application/json" -d '{"item": "i1", "numericRangeFilter": [{"name":"price", "greaterThan":20, "lessThanOrOrEqual":90},{"name":"popRank, "greaterThan":2, "lessThan":19}]}' http://localhost:8000/queries.json

r4sn4 commented 7 years ago

For numericRangeFilter , mapping type of fields in Elastic Search should be double or so.

In UR all the fields are stored with mapping type string.

pferrel commented 7 years ago

Does this actually work? Not sure what your comment means.

r4sn4 commented 7 years ago

I am storing price as one of the item properties while setting items in hbase using $set.

In order for this numeric range filte to work, I made some changes in esClient.scala so that it stores mappingType of price as "double" in ES.

On Sat, Nov 5, 2016 at 6:45 AM, Rasna Tomar rasna.tomar@gmail.com wrote:

yes it works.... we are using in our project.

Which comment?

On Fri, Nov 4, 2016 at 11:56 PM, Pat Ferrel notifications@github.com wrote:

Does this actually work? Not sure what your comment means.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pferrel/template-scala-parallel-universal-recommendation/pull/20#issuecomment-258511422, or mute the thread https://github.com/notifications/unsubscribe-auth/AIA1E9gNMvNgURX8iLKt5FQ6MdVzEadyks5q63jsgaJpZM4KpL2F .