setField($field); } /** * Set the field name from which to fetch candidate suggestions. * * @return $this */ public function setField(string $field) { return $this->setParam('field', $field); } /** * Set the maximum corrections to be returned per suggest text token. * * @return $this */ public function setSize(int $size) { return $this->setParam('size', $size); } /** * @param string $mode see SUGGEST_MODE_* constants for options * * @return $this */ public function setSuggestMode(string $mode) { return $this->setParam('suggest_mode', $mode); } /** * @param int $max can only be a value between 1 and 2. Defaults to 2. * * @return $this */ public function setMaxEdits(int $max) { return $this->setParam('max_edits', $max); } /** * @param int $length defaults to 1 * * @return $this */ public function setPrefixLength(int $length) { return $this->setParam('prefix_length', $length); } /** * @param int $min defaults to 4 * * @return $this */ public function setMinWordLength(int $min) { return $this->setParam('min_word_length', $min); } /** * @return $this */ public function setMaxInspections(int $max) { return $this->setParam('max_inspections', $max); } /** * @return $this */ public function setMinDocFrequency(float $min) { return $this->setParam('min_doc_freq', $min); } /** * @return $this */ public function setMaxTermFrequency(float $max) { return $this->setParam('max_term_freq', $max); } /** * Set an analyzer to be applied to the original token prior to candidate generation. * * @param string $pre an analyzer * * @return $this */ public function setPreFilter(string $pre) { return $this->setParam('pre_filter', $pre); } /** * Set an analyzer to be applied to generated tokens before they are passed to the phrase scorer. * * @return $this */ public function setPostFilter(string $post) { return $this->setParam('post_filter', $post); } }