Anish
Anish

Reputation: 558

elastic search give following error in console rails

searching using elastic search gives me following error on console

{"_shards":{"total":5,"successful":0,"failed":5,"failures":[{"index":"test","shard":4,"reason":"BroadcastShardOperationFailedException[[test][4] ]; nested: ElasticSearchException[failed to execute suggest]; nested: ElasticSearchIllegalArgumentException[[suggest] does not support [size]]; "},{"index":"test","shard":3,"reason":"BroadcastShardOperationFailedException[[test][3] ]; nested: ElasticSearchException[failed to execute suggest]; nested: ElasticSearchIllegalArgumentException[[suggest] does not support [size]]; "},{"index":"test","shard":2,"reason":"BroadcastShardOperationFailedException[[test][2] ]; nested: ElasticSearchException[failed to execute suggest]; nested: ElasticSearchIllegalArgumentException[[suggest] does not support [size]]; "},{"index":"test","shard":0,"reason":"BroadcastShardOperationFailedException[[test][0] ]; nested: ElasticSearchException[failed to execute suggest]; nested: ElasticSearchIllegalArgumentException[[suggest] does not support [size]]; "},{"index":"test","shard":1,"reason":"BroadcastShardOperationFailedException[[test][1] ]; nested: ElasticSearchException[failed to execute suggest]; nested: ElasticSearchIllegalArgumentException[[suggest] does not support [size]]; "}]}}

not able to understand probable reason for this i am using tire/karmi for this the ES version is 0.9.9

this is my mapping code

{
  "test" : {
 "document" : {
  "properties" : {
    "artikelnummer" : {
      "type" : "string",
      "index" : "not_analyzed",
      "omit_norms" : true,
      "index_options" : "docs"
    },
    "bestelltext" : {
      "type" : "multi_field",
      "fields" : {
        "bestelltext" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "bezeichnung" : {
      "type" : "multi_field",
      "fields" : {
        "bezeichnung" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        },
        "suggest" : {
          "type" : "string",
          "analyzer" : "suggest_analyzer",
          "include_in_all" : false
        }
      }
    },
    "bezeichnung_zusatz" : {
      "type" : "multi_field",
      "fields" : {
        "bezeichnung_zusatz" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "dimension" : {
      "type" : "string",
      "include_in_all" : false
    },
    "eannummer" : {
      "type" : "string",
      "index" : "not_analyzed",
      "omit_norms" : true,
      "index_options" : "docs"
    },
    "gewicht" : {
      "type" : "float",
      "include_in_all" : false
    },
    "gruppe" : {
      "type" : "multi_field",
      "fields" : {
        "gruppe" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "gruppe_nummer" : {
      "type" : "string",
      "index" : "not_analyzed",
      "omit_norms" : true,
      "index_options" : "docs",
      "include_in_all" : false
    },
    "gruppe_zusatz" : {
      "type" : "multi_field",
      "fields" : {
        "gruppe_zusatz" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "hersteller" : {
      "type" : "multi_field",
      "fields" : {
        "hersteller" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        },
        "unchanged" : {
          "type" : "string",
          "index" : "not_analyzed",
          "omit_norms" : true,
          "index_options" : "docs",
          "include_in_all" : false
        }
      }
    },
    "hersteller_artikelnummer" : {
      "type" : "string",
      "index" : "not_analyzed",
      "omit_norms" : true,
      "index_options" : "docs"
    },
    "hersteller_nummer" : {
      "type" : "string",
      "index" : "not_analyzed",
      "omit_norms" : true,
      "index_options" : "docs",
      "include_in_all" : false
    },
    "hierarchie" : {
      "type" : "multi_field",
      "fields" : {
        "hierarchie" : {
          "type" : "string",
          "index_analyzer" : "hierarchie_index_analyzer",
          "search_analyzer" : "keyword",
          "include_in_all" : false
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "infotext" : {
      "type" : "multi_field",
      "fields" : {
        "infotext" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "langtext" : {
      "type" : "multi_field",
      "fields" : {
        "langtext" : {
          "type" : "string"
        },
        "ngram" : {
          "type" : "string",
          "index_analyzer" : "ngram_index_analyzer",
          "search_analyzer" : "ngram_search_analyzer",
          "include_in_all" : false
        }
      }
    },
    "listenpreis_brutto" : {
      "type" : "float",
      "include_in_all" : false
    },
    "listenpreis_netto" : {
      "type" : "float",
      "include_in_all" : false
    },
    "matchcode" : {
      "type" : "string",
      "index" : "not_analyzed",
      "omit_norms" : true,
      "index_options" : "docs"
    },
    "mengeneinheit" : {
      "type" : "string",
      "include_in_all" : false
    }
  }
}

} }

Upvotes: 0

Views: 451

Answers (1)

Garry Welding
Garry Welding

Reputation: 3609

This has got nothing to do with your mapping. It's to do with the search call you're making. Somewhere you'll have the "size" keywords within your call to the search API.

It looks like you're using the suggester endpoint and you've got the "size" keyword directly under the "suggest" keyword. Here's an example of my PHP code (I know it's not in Ruby but it still illustrates the point).

    $searchParams['body']['suggest'] = array(
        'text' => strtolower(trim(urldecode($query))),
        'simple_phrase' => array(
            'phrase' => array(
                'field' => "name",
                'size' => 4,
                'real_word_error_likelihood' => 0.95,
                'confidence' => 1.0,
                'gram_size' => 1,
                'direct_generator' => array(
                    array(
                        "field" => "name",
                        "suggest_mode" => "always",
                        "min_word_len" => 1
                    ),
                    array(
                        "field" => "name_reverse",
                        "suggest_mode" => "always",
                        "min_word_len" => 1,
                        "pre_filter" => "reverse",
                        "post_filter" => "reverse"
                    )
                )
            )
        )
    );

You see how I have the "size" keyword under the phrase suggester, rather than under suggester directly.

Upvotes: 0

Related Questions