GithubHelp home page GithubHelp logo

alexkolonitsky / lucidworks-view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucidworks/lucidworks-view

0.0 0.0 1.0 7.12 MB

Create custom user experiences for your Fusion-powered apps.

Home Page: https://lucidworks.com/products/view

License: Apache License 2.0

JavaScript 39.53% CSS 43.04% HTML 17.30% Shell 0.13%

lucidworks-view's People

Contributors

alexkolonitsky avatar arijitdasgupta avatar gsingers avatar irinaagamyan avatar joshellinger avatar laurel avatar

Watchers

 avatar

Forkers

evansayer

lucidworks-view's Issues

Use `display_type` instead of `type`

Rules now have a display_type field. A couple of example documents below.

The display_type values are: Redirect, Banner, Set Query Params, Filter List, Block List, Boost List (and Query Rewrite, but this isn't needed here yet)

  {
    "id": "redirect-simple",
    "description": "Simple keyword redirect",
    "type": "response_value",
    "display_type": "Redirect",
    "search_terms": "Unsubscribe",
    "keys": [
      "redirect"
    ],
    "values": [
      "/customer_service.html"
    ]
  },
  {
    "id": "banner-date-ranges",
    "description": "Pi Day (US: March 14 = 3/14)",
    "type": "response_value",
    "display_type": "Banner",
    "effective_range": ["2016-03-14", "2017-03-14"],
    "keys": [
      "banner"
    ],
    "values": [
      "Happy Pi Day!"
    ]
  }

Date triggers do not save to Solr

image

Added that rule and it appeared in the UI, but refreshing didn't show it, so it had an error saving I bet.

Will look into logs to see what's being sent incorrectly, but I imagine the effective_range value sent isn't valid.

A simpler thing would be to simply have a single text box to start with, as the syntax for this beast can be hairy to get just right, to be the best for what the business user needs to specify simply.

“Add Trigger->Date”

The start/end dates were an option related to a trigger - by default, they are not assigned values. So, the “Add Trigger” would allow you to assign values to them. We have to start/end date UI fields make hidden at the top of the form until the user selects “Add Trigger->Date” and then make them visible and editable.

The default value for the dates will be an empty string.

Save it in solr as
effective_range: DateRangeField, multivalued (optional)

Name uniqueness

Enforce rule name uniqueness during add and update operations. This can be enforced by using Solr field type unique attribute property or assigning the rule name to the id field.

Add "filter" trigger type

A category can accept a field name (e.g. 'category_id') and field value (e.g. '1000') which can support multiple values. Support for a single value is the priority at this point - multiple can be added later.

"Set Params" rule type

Needs to utilize the "Set Params" rule type to accomplish this. It will require a 3 column (Policy, Name, Value) table to capture these types of rules.

Solr implementation:
params_keys: request parameter name, must align with param_values and param_policies, string, multivalued
params_values: request parameter value, must align with param_keys and param_policies, string, multivalued
params_policies: request parameter policy, either append or replace, must align with param_keys and param_values, string, multivalued

set_params documents examples
{"tags":["TEST"],"id":"block-kingbed","type":"set_params","search_terms":"king bed","param_keys":["fq"],"param_values":["*:* -(_text_:\"bedhead\")"],"param_policies":["append"],"param_modes":["phrase"]}

{"tags":["TEST"],"id":"sp-createAShop-purses2_set-query-params","type":"set_params","search_terms":"purses","param_keys":["q","qf","q.op"],"param_values":["CategoryID:7905 CategoryID:7907 CategoryID:7910 CategoryID:7902","CategoryID:7905^40 CategoryID:7907^30 CategoryID:7910^20 CategoryID:7902^10","OR"],"param_policies":["replace","replace","replace"]}

Fusion’s query pipeline javascript stage for set_params handling:

case 'set_params':
        for (var px=0; px < rule_doc.param_keys.size(); px++) {
          switch (rule_doc.param_policies[px]) {
            case 'append':
              request.addParam(rule_doc.param_keys[px], rule_doc.param_values[px]);
              break

            case 'replace':
              request.putSingleParam(rule_doc.param_keys[px], rule_doc.param_values[px]);
              break
          }
        }
        break;

Add remove trigger button

If for example you've added keyword trigger accidentally I'll want to remove it, we need to provide a way to do that at creation and edition forms.

Correct spelling of `Description`

Description not Descrition - in the label and the id="addRuleDescrition"

                  <div class="form-group">
                    <label for="addRuleDescrition" class="small text-muted text-uppercase">Description</label>
                    <textarea rows="1" class="form-control" id="addRuleDescrition" placeholder="Enter rule description" ng-model="currentRule.ruleDescription"></textarea>
                  </div>

Implement the "Product List" rule type to support three possible methods: "Boost", "Block" and "Filter"

The priority should be on Boost

  {
    "id": "block_ids1",
    "description": "Block list of ids",
    "type": "block_ids",
    "search_terms": ["grill"],
    "ids": ["2"]
  },
  {
    "id": "filter_ids1",
    "description": "Custom product list",
    "type": "filter_ids",
    "search_terms": ["mylist"],
    "ids": ["2","163120"]
  },
  {
    "id": "boost_ids1",
    "description": "boost list",
    "type": "boost_ids",
    "search_terms": ["apron"],
    "ids": ["163120"]
  }

Don't comma-separate banner/redirect rule strings

image

I created a "Hello, World!" banner (no quotes) and it split the banner rule into two values. Note it is mandatory that keys and values are one-to-one in sync with each other, same number of related values - hope that makes sense. Same with redirect, maybe?

image

Fix Status facet

Looks like currently the Status (aka enabled) facet isn't functional. We can add facet.field=enabled to the default bsb_products_rules pipeline and show "Enabled" and "Disabled" as the values.

Query Set rule type

A decision was made to drop the "Query Set" rule type which behaves like a query rewrite and was intended for a customer project. This feature will need more definition before it can be included.

Product List action should be saved as set_params rule

We can add 3 types of ids lists: boost ids, list ids and blocked ids

Example:

{"tags":["TEST"],"id":"sp-createAShop-boy2roomsx_set-
params","type":"set_params","search_terms":"boy2roomsx","param_keys":
["q.op","q"],"param_values":["OR","ProductID:GA241 ProductID:NQ123 ProductID:PL072
ProductID:685 ProductID:DCR99 ProductID:DDC61 ProductID:DDC83 ProductID:F2018 
ProductID:F6539 ProductID:F8754 ProductID:G4665 ProductID:G5999 ProductID:G6618 
ProductID:G6747 ProductID:G7181 ProductID:G7444 ProductID:G7454 ProductID:G7456 
ProductID:G7457 ProductID:G7458 ProductID:G7832 ProductID:G8086 ProductID:G8248 
ProductID:G8267 ProductID:G8355 ProductID:G8483 ProductID:G8484 ProductID:G8549 
ProductID:G8726 ProductID:G8733 ProductID:G8764 ProductID:G8783 ProductID:G9079 
ProductID:G9106 ProductID:G9113 ProductID:G9293 ProductID:G9308 ProductID:G9337 
ProductID:G9360 ProductID:G9372 ProductID:G9373 ProductID:G9488 ProductID:G9751 
ProductID:G9879 ProductID:G9882 ProductID:G9883 ProductID:ga044 ProductID:GA124 
ProductID:GA125 ProductID:ga149qs ProductID:GA175 ProductID:GA182 ProductID:GA238 
ProductID:ga241 ProductID:ga243 ProductID:GA410 ProductID:GA411 ProductID:GA430 
ProductID:GA479 ProductID:GA480 ProductID:GA525 ProductID:GA767 ProductID:GB447 
ProductID:J9493 ProductID:K7195 ProductID:K8874 ProductID:K8876 ProductID:K8877 
ProductID:K8878 ProductID:K9690 ProductID:K9972 ProductID:KA933 ProductID:KA935 
ProductID:KB170 ProductID:N4829 ProductID:ND767 ProductID:NG220 ProductID:NG223 
ProductID:NM301 ProductID:NM686 ProductID:NR286 ProductID:NT063 ProductID:NT081 
ProductID:NZ573 ProductID:PB336 ProductID:PB428 ProductID:PB745 ProductID:PB755 
ProductID:PC218 ProductID:PD839 ProductID:PG264 ProductID:PG438 ProductID:PK919 
ProductID:pr651 ProductID:pt152 ProductID:PU886 ProductID:PV812 ProductID:PX234 
ProductID:PY620 ProductID:PZ129 ProductID:PZ130 ProductID:QB036 ProductID:QC155 
ProductID:QC157 ProductID:QC496 ProductID:QC906 ProductID:QD190 ProductID:qe031 
ProductID:qe033 ProductID:qe498 ProductID:QE878 ProductID:QE974 ProductID:QH619 
ProductID:QX516 ProductID:RQ806 "],"param_policies":["replace","replace"]}```

Change rule creation form

At third column we have fields corresponding particular rule types (Products list (Filter list, Block list, Boost list), Banner, Redirect, Set Params) and see image

create rule corrections

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.