codelibs / elasticsearch-minhash

Elasticsearch plugin for b-bit minhash algorism
Apache License 2.0
62 stars 14 forks source link

First position increment must be > 0 (got 0) for field hash #9

Open pkmital opened 7 years ago

pkmital commented 7 years ago

I've tried a few combinations of things in 5.6 without much luck. First I tried:

curl -XPUT '192.168.1.2:9200/wordvec' -d '{
  "settings": {
    "analysis": {
      "filter": {
        "min_hash_filter": {
          "type": "min_hash"
        }
      },
      "analyzer": {
        "minhash_analyzer": {
          "type": "custom",
          "tokenizer": "keyword",
          "filter": ["minhash"]
        }
      }
    }
  }
}'
curl -XPUT '192.168.1.2:9200/wordvec/_mapping/fasttext' -d '{
  "fasttext": {
    "properties": {
      "word": {
        "type": "text"
      },
      "vector": {
        "type": "keyword",
        "copy_to": "hash"
      },
      "hash": {
        "type": "minhash",
        "analyzer": "minhash_analyzer",
        "store": "true",
        "index": "analyzed"
      }
    }
  }
}

and get:

"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [hash] has different [index] values from other types of the same index"

So then try setting the vector field to string, which gets set to text by 5.6 as it seems like string is deprecated, but keeping the hash field as type minhash, and get the following error:

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [hash] has different [index] values from other types of the same index"}],"type":"illegal_argument_exception","reason":"mapper [hash] has different [index] values from other types of the same index"}

So then I try setting the hash field to string as well, and this at least lets me create the mapping, but then when I go to push some data, I get:

        "error" : {
          "type" : "illegal_argument_exception",
          "reason" : "first position increment must be > 0 (got 0) for field 'hash'"
        }

Any ideas would be much appreciated!

Thanks so much

marevol commented 7 years ago

README is old.. Fess uses this plugin in fess.json.