YousefED / ElasticUI

AngularJS directives for Elasticsearch
http://www.elasticui.com
Other
526 stars 138 forks source link

UI Router and eui-or-filter #69

Open devads opened 8 years ago

devads commented 8 years ago

Hi Yousef !

Again me :-)

I have something strange this time, in my SPA Angular I added UI Router, it works great when you are not using eui-or-filter (because it keeps your fields selected) like you can see in this link Codepen working without eui-or-filter

PS : I use the same data as before, I give you again if you don't have

DELETE /cars_ex/

PUT /cars_ex/

PUT cars_ex/transactions/_mapping/
{
  "transactions": {
   "properties": {
    "brand": {
      "type": "string",
      "fields": {
        "raw":   { "type": "string", "index": "not_analyzed" }
      }},
     "model": {
      "type": "string",
      "fields": {
        "raw":   { "type": "string", "index": "not_analyzed" }
      }}
    }
  }
}
}

POST /cars_ex/transactions/_bulk
{ "index": {}}
{ "price" : 12100, "title" : "Honda Civic 1.6 120ch i-DTEC Business", "brand" : "Honda", "model" : "Civic" }
{ "index": {}}
{ "price" : 15290, "title" : "Honda CR-V 1.6 i-DTEC 160 Exclusive Navi 4WD AT", "brand" : "Honda", "model" : "CR-V" }
{ "index": {}}
{ "price" : 18000, "title" : "BMW SERIE 1 114D 95CH LOUNGE START EDITION 5P", "brand" : "BMW", "model" : "Série 1" }
{ "index": {}}
{ "price" : 25000, "title" : "BMW SÉRIE 3 316DA 116CH LOUNGE START EDITION", "brand" : "BMW", "model" : "Série 3" }
{ "index": {}}
{ "price" : 7990, "title" : "OPEL KARL 1.0 75CH ESSENTIA", "brand" : "Opel", "model" : "Karl" }
{ "index": {}}
{ "price" : 8990, "title" : "OPEL CORSA 1.2 70CH ESSENTIA 3P", "brand" : "Opel", "model" : "Corsa" }
{ "index": {}}
{ "price" : 14990, "title" : "KIA CEED 1.4 CRDI 90CH MOTION", "brand" : "Kia", "model" : "Ceed" }
{ "index": {}}
{ "price" : 22490, "title" : "KIA CARENS 1.7 CRDI 115CH ACTIVE ISG 5 PLACES", "brand" : "Kia", "model" : "Carens" }
{ "index": {}}
{ "price" : 25900, "title" : "VOLKSWAGEN GOLF SPORTSVAN", "brand" : "Volkswagen", "model" : "Golf Sportsvan" }

If you selected the brand BMW and you click on link About above and click on Home to come back, your filters are well checked.

But if you add the eui-or-filter, If you do the same thing you lost your selection Codepen not working with eui-or-filter

I tried to understand what happened but without success for the moment. With eui-or-filter you lost filters.ejsObjects if you use routing.

Thanks a lot,