Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-17346

Cannot use list widget on a multivalued metadata in a search form

    XMLWordPrintable

    Details

      Description

      Steps to reproduce:

      • In Nuxeo Studio, create a schema with a multivalued string metadata
      • Create a search content view using elasticsearch index
      • Drop that metadata in the search layout
      • Default options are LIKE operator, list widget
      • Change operator to ILIKE
      • Save and deploy

      => When using the search form, query sent is incorrect and can lead to errors, see following elasticsearch log

      2015-06-19 16:38:23,262 DEBUG [http-bio-0.0.0.0-8080-exec-9][org.nuxeo.elasticsearch.provider.ElasticSearchNxqlPageProvider] Perform query for provider 'bookSearchCV': with pageSize=10, offset=0{{RemoteAddr,127.0.0.1}{RequestURL,http://localhost:8080/nuxeo/search/search.faces}{ServletPath,/search/search.faces}{SessionID,0900E8E32444CA74CB90EBA11C5A7F24.nuxeo}{UserPrincipal,Administrator}}
      2015-06-19 16:38:23,262 DEBUG [http-bio-0.0.0.0-8080-exec-9][org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl] Search query: curl -XGET 'http://localhost:9200/nuxeo/doc/_search?pretty' -d '{
        "from" : 0,
        "size" : 10,
        "query" : {
          "bool" : {
            "must" : [ {
              "wildcard" : {
                "book:subjects.lowercase" : {
                  "wildcard" : "[ljava.lang.string;@a8cd005"
                }
              }
            }, {
              "bool" : {
                "must" : [ {
                  "constant_score" : {
                    "filter" : {
                      "not" : {
                        "filter" : {
                          "term" : {
                            "ecm:mixinType" : "HiddenInNavigation"
                          }
                        }
                      }
                    }
                  }
                }, {
                  "constant_score" : {
                    "filter" : {
                      "term" : {
                        "ecm:isVersion" : "0"
                      }
                    }
                  }
                }, {
                  "constant_score" : {
                    "filter" : {
                      "not" : {
                        "filter" : {
                          "term" : {
                            "ecm:currentLifeCycleState" : "deleted"
                          }
                        }
                      }
                    }
                  }
                }, {
                  "constant_score" : {
                    "filter" : {
                      "term" : {
                        "ecm:primaryType" : "Book"
                      }
                    }
                  }
                } ]
              }
            } ]
          }
        },
        "fields" : "_id",
        "aggregations" : {
          "book_publicationDate_agg_filter" : {
            "filter" : {
              "match_all" : { }
            },
            "aggregations" : {
              "book_publicationDate_agg" : {
                "date_range" : {
                  "field" : "book:publicationDate",
                  "ranges" : [ {
                    "key" : "from_now-1M_to_now",
                    "from" : "now-1M",
                    "to" : "now"
                  }, {
                    "key" : "from_now-7d_to_now",
                    "from" : "now-7d",
                    "to" : "now"
                  }, {
                    "key" : "from_now_to_",
                    "from" : "now"
                  }, {
                    "key" : "from__to_now",
                    "to" : "now"
                  } ]
                }
              }
            }
          },
          "book_category_agg_filter" : {
            "filter" : {
              "match_all" : { }
            },
            "aggregations" : {
              "book_category_agg" : {
                "terms" : {
                  "field" : "book:category",
                  "order" : {
                    "_count" : "desc"
                  }
                }
              }
            }
          }
        }
      }'{{RemoteAddr,127.0.0.1}{RequestURL,http://localhost:8080/nuxeo/search/search.faces}{ServletPath,/search/search.faces}{SessionID,0900E8E32444CA74CB90EBA11C5A7F24.nuxeo}{UserPrincipal,Administrator}}
      2015-06-19 16:38:23,265 DEBUG [http-bio-0.0.0.0-8080-exec-9][org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl] Response: {
        "took" : 3,
        "timed_out" : false,
        "_shards" : {
          "total" : 1,
          "successful" : 1,
          "failed" : 0
        },
        "hits" : {
          "total" : 0,
          "max_score" : null,
          "hits" : [ ]
        },
        "aggregations" : {
          "book_category_agg_filter" : {
            "doc_count" : 0,
            "book_category_agg" : {
              "buckets" : [ ]
            }
          },
          "book_publicationDate_agg_filter" : {
            "doc_count" : 0,
            "book_publicationDate_agg" : {
              "buckets" : [ {
                "key" : "from__to_now",
                "to" : 1.434724703262E12,
                "to_as_string" : "2015-06-19T14:38:23.262Z",
                "doc_count" : 0
              }, {
                "key" : "from_now-1M_to_now",
                "from" : 1.432046303262E12,
                "from_as_string" : "2015-05-19T14:38:23.262Z",
                "to" : 1.434724703262E12,
                "to_as_string" : "2015-06-19T14:38:23.262Z",
                "doc_count" : 0
              }, {
                "key" : "from_now-7d_to_now",
                "from" : 1.434119903262E12,
                "from_as_string" : "2015-06-12T14:38:23.262Z",
                "to" : 1.434724703262E12,
                "to_as_string" : "2015-06-19T14:38:23.262Z",
                "doc_count" : 0
              }, {
                "key" : "from_now_to_",
                "from" : 1.434724703262E12,
                "from_as_string" : "2015-06-19T14:38:23.262Z",
                "doc_count" : 0
              } ]
            }
          }
        }
      }{{RemoteAddr,127.0.0.1}{RequestURL,http://localhost:8080/nuxeo/search/search.faces}{ServletPath,/search/search.faces}{SessionID,0900E8E32444CA74CB90EBA11C5A7F24.nuxeo}{UserPrincipal,Administrator}}
      

      Note the

      "wildcard" : "[ljava.lang.string;@a8cd005"
      

      issue must be from org.nuxeo.ecm.platform.query.nxql.NXQLQueryBuilder.

      This is now visible thanks to NXS-2339

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bchauvin Bertrand Chauvin
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: