private function getDefaultSearchProperty($field = self::DEFAULT_SEARCH_FIELD, $analyzer = null)
    {
        if (!isset($this->defaultMappingFields[$field])) {
            throw new \InvalidArgumentException("Unable to find field {$field}.");
        }

        $property = $field;

        if ($analyzer !== null) {
            if (!in_array($analyzer, $this->defaultMappingFields[$field])) {
                throw new \InvalidArgumentException("Unable to find analyzer {$analyzer} for field {$field}.");
            }

            $property = sprintf("%s.%s", $field, $analyzer);
        }

        return $property;
    }
private function getDefaultSearchProperty($field = self::DEFAULT_SEARCH_FIELD, $analyzer = null)
    {
        if (!isset($this->defaultMappingFields[$field])) {
            throw new \InvalidArgumentException("Unable to find field {$field}.");
        }

        $property = $field;

        if ($analyzer !== null) {
            if (!in_array($analyzer, $this->defaultMappingFields[$field])) {
                throw new \InvalidArgumentException("Unable to find analyzer {$analyzer} for field {$field}.");
            }

            $property = sprintf("%s.%s", $field, $analyzer);
        }

        return $property;
    }
private function getDefaultSearchProperty ( $ field = self :: DEFAULT_SEARCH_FIELD , $ analyzer = null ) { if ( ! isset ( $ this -> defaultMappingFields [ $ field ] ) ) { throw new \ InvalidArgumentException ( "Unable to find field {$field}." ) ; } $ property = $ field ; if ( $ analyzer !== null ) { if ( ! in_array ( $ analyzer , $ this -> defaultMappingFields [ $ field ] ) ) { throw new \ InvalidArgumentException ( "Unable to find analyzer {$analyzer} for field {$field}." ) ; } $ property = sprintf ( "%s.%s" , $ field , $ analyzer ) ; } return $ property ; }
Return the search property for a field present in defaultMappingFields.

@throws \InvalidArgumentException If the field / analyzer does not exists.

@param string $field    Field.
@param string $analyzer Required analyzer.

@return string
Return the search property for a field present in defaultMappingFields .