elasticsearch-entity-resolution icon indicating copy to clipboard operation
elasticsearch-entity-resolution copied to clipboard

Nested fields

Open edolix opened this issue 8 years ago • 0 comments

Hello!

Is there a method to use this plugin on nested field? Mapping is:

{
  "components": {
    "mappings": {
      "component": {
        "properties": {
          ... OTHER FIELDS ...
          "values": {
            "type": "nested",
            "properties": {
              "field_id": {
                "type": "integer"
              },
              "field_name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}

I tried using "dot" with values.field_id or values.value but it seems not work. This is one of my test:

{
  "size": 10,
  "query": {
    "function_score": {
      "boost_mode": "replace",
      "query": {
        "match": { "category_id":  1235 }
      },
      "script_score": {
        "script": "entity-resolution",
        "lang": "native",
        "params": {
          "entity": {
            "fields": [
              {
                "field": "values.field_id",
                "value": "16100",
                "cleaners": [
                  {
                    "name": "no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"
                  }
                ],
                "comparator": {
                  "name": "no.priv.garshol.duke.comparators.ExactComparator"
                }
              },
              {
                "field": "values.value",
                "value": "52,000 mm",
                "cleaners": [
                  {
                    "name": "no.priv.garshol.duke.cleaners.LowerCaseNormalizeCleaner"
                  }
                ],
                "high": 0.8,
                "comparator": {
                  "name": "no.priv.garshol.duke.comparators.JaroWinkler"
                },
                "low": 0.3
              }
            ]
          }
        }
      }
    }
  }
}

Thanks!

edolix avatar Jul 01 '16 08:07 edolix