floriansemm / SolrBundle

Solr-Integration into Symfony and Doctrine2
http://floriansemm.github.io/SolrBundle
MIT License
123 stars 73 forks source link

Soir Http error: Http request failed. Could not resolve host:host #163

Closed michau85 closed 7 years ago

michau85 commented 7 years ago

Hello. It's my first time I'm trying to use SolrBundle in my symfony project istalled on xampp. Always when I try to use solr:index:populate I receive error mentioned in title. What am I doing wrong? Many thanks for help in advance. Below my configuration

config.yml

fs_solr:
   endpoints:
        core0:
          host: host
           port: 8983
           path: /solr/core0
           core: corename
           timeout: 5 

Post Entity

 use Doctrine\ORM\Mapping as ORM;
 use FS\SolrBundle\Doctrine\Annotation as Solr;

/**
 * Post
 * @Solr\Document()
 * @ORM\Table(name="post")
 * @ORM\Entity(repositoryClass="SklepBundle\Repository\PostRepository")
 */
class Post
{ 
  /**
  * @Solr\Id
 * 
 * @var int
 *
 * @ORM\Column(name="id", type="integer")
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="AUTO")
 */
private $id;

/**
 * @Solr\Field(type="string")
 * @var string
 *
 * @ORM\Column(name="title", type="string", length=255)
 */
private $title;

/**
 * @var string
 *
 * @ORM\Column(name="text", type="string", length=255)
 */
private $text;

/**
 * @var \DateTime
 *
 * @ORM\Column(name="created_at", type="datetime")
 */
private $createdAt;

/**
 * Get id
 *
 * @return int
 */
public function getId()
{
    return $this->id;
}

/**
 * Set title
 *
 * @param string $title
 *
 * @return Post
 */
public function setTitle($title)
{
    $this->title = $title;

    return $this;
}

/**
 * Get title
 *
 * @return string
 */
public function getTitle()
{
    return $this->title;
}

/**
 * Set text
 *
 * @param string $text
 *
 * @return Post
 */
public function setText($text)
{
    $this->text = $text;

    return $this;
}

/**
 * Get text
 *
 * @return string
 */
public function getText()
{
    return $this->text;
}

/**
 * Set createdAt
 *
 * @param \DateTime $createdAt
 *
 * @return Post
 */
public function setCreatedAt($createdAt)
{
    $this->createdAt = $createdAt;

    return $this;
}

/**
 * Get createdAt
 *
 * @return \DateTime
 */
public function getCreatedAt()
{
    return $this->createdAt;
}
floriansemm commented 7 years ago

the option host must something like localhost or the IP of your Solr instance.