yawik / Solr

This YAWIK module enables solr search for job openings.
http://jobs.yawik.org
MIT License
1 stars 2 forks source link

Use viewHelper, when storing location in solr #28

Closed cbleek closed 4 years ago

cbleek commented 4 years ago

can we use our new viewHelper when saving the "location" in solr?

The value, which is stored in Solr:

Solr-solcation

https://github.com/yawik/Solr/blob/master/src/Entity/JobProxy.php#L358

cbleek commented 4 years ago

Yawik stores locations as an array of objects.

> db.jobs.find({_id:ObjectId("5c8115410acec3d470a03e41")},{locations:1}).pretty();
{
        "_id" : ObjectId("5c8115410acec3d470a03e41"),
        "locations" : [
                {
                        "city" : "Vechta",
                        "region" : "Niedersachsen",
                        "coordinates" : {
                                "type" : "Point",
                                "coordinates" : [
                                        8.28598,
                                        52.72632
                                ],
                                "_entity" : "Geo\\Entity\\Geometry\\Point"
                        }
                }
        ]
}

Solr/blob/master/src/Entity/JobProxy.php#L358 stores a location by simply:

    /**
     * @see \Jobs\Entity\JobInterface::setLocation()
     */
    public function setLocation($location)
    {
        return $this->job->setLocation($location);
    }

the location field in solr is a sting. After saving a job in our demo, the location in solr contains "location":"Vechta, Niedersachsen ( 8.28598, 52.72632 )",

TiSiE commented 4 years ago

Problem is in another module (yawik/DemoSkin)