Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic support for solr spatial search features while using ezgmaplocation extension #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions classes/ezfsolrdocumentfieldgmaplocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ezfSolrDocumentFieldGmapLocation extends ezfSolrDocumentFieldBase
{
public static $subattributesDefinition = array( self::DEFAULT_SUBATTRIBUTE => 'text',
'coordinates' => 'geopoint',
'location' => 'location',
'geohash' => 'geohash',
'latitude' => 'float',
'longitude' => 'float' );
Expand Down Expand Up @@ -44,6 +45,7 @@ public function getData()
if ( !empty( $longitude ) && !empty( $latitude ) )
{
$data[self::getFieldName( $contentClassAttribute, 'coordinates' )] = $longitude . ',' . $latitude;
$data[self::getFieldName( $contentClassAttribute, 'location' )] = $latitude . ',' . $longitude;
//almost the same input format, Solr will take care of the conversion to a geohash string
//disabled for now, need to update Solr.war first
//$data[self::getFieldName( $contentClassAttribute, 'geohash' )] = $longitude . ' ' . $latitude;
Expand Down
1 change: 1 addition & 0 deletions classes/ezfsolrdocumentfieldname.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ static function getPostFix( $fieldType )
'tlong' => 'tl',
'tdate' => 'tdt',
'geopoint' => 'gpt',
'location' => 'loc',
'geohash' => 'gh',
'mstring' => 'ms',
'mtext' => 'mt',
Expand Down
8 changes: 8 additions & 0 deletions java/solr.multicore/eng-GB/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@
<dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*_gpt" type="geopoint" indexed="true" stored="true"/>
<!-- location for geospatial searches -->
<dynamicField name="*_loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*_loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*_loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*_bst" type="binary" indexed="false" stored="true"/>

Expand Down Expand Up @@ -687,6 +691,10 @@
<dynamicField name="*____tdt" type="tdate" indexed="true" stored="true" multiValued="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*____gpt" type="geopoint" indexed="true" stored="true" multiValued="true"/>
<!-- location for geospatial search -->
<dynamicField name="*____loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*____loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*____loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*____bst" type="binary" indexed="false" stored="true" multiValued="true"/>

Expand Down
8 changes: 8 additions & 0 deletions java/solr.multicore/fre-FR/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@
<dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*_gpt" type="geopoint" indexed="true" stored="true"/>
<!-- location for geospatial searches -->
<dynamicField name="*_loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*_loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*_loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*_bst" type="binary" indexed="false" stored="true"/>

Expand Down Expand Up @@ -686,6 +690,10 @@
<dynamicField name="*____tdt" type="tdate" indexed="true" stored="true" multiValued="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*____gpt" type="geopoint" indexed="true" stored="true" multiValued="true"/>
<!-- location for geospatial search -->
<dynamicField name="*____loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*____loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*____loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*____bst" type="binary" indexed="false" stored="true" multiValued="true"/>

Expand Down
8 changes: 8 additions & 0 deletions java/solr.multicore/nor-NO/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@
<dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*_gpt" type="geopoint" indexed="true" stored="true"/>
<!-- location for geospatial searches -->
<dynamicField name="*_loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*_loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*_loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*_bst" type="binary" indexed="false" stored="true"/>

Expand Down Expand Up @@ -687,6 +691,10 @@
<dynamicField name="*____tdt" type="tdate" indexed="true" stored="true" multiValued="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*____gpt" type="geopoint" indexed="true" stored="true" multiValued="true"/>
<!-- location for geospatial search -->
<dynamicField name="*____loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*____loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*____loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*____bst" type="binary" indexed="false" stored="true" multiValued="true"/>

Expand Down
8 changes: 8 additions & 0 deletions java/solr/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,10 @@
<dynamicField name="*_tdt" type="tdate" indexed="true" stored="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*_gpt" type="geopoint" indexed="true" stored="true"/>
<!-- location for geospatial searches -->
<dynamicField name="*_loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*_loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*_loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*_bst" type="binary" indexed="false" stored="true"/>

Expand Down Expand Up @@ -685,6 +689,10 @@
<dynamicField name="*____tdt" type="tdate" indexed="true" stored="true" multiValued="true"/>
<!-- geopoint for geospatial/location searches, boosting, ... -->
<dynamicField name="*____gpt" type="geopoint" indexed="true" stored="true" multiValued="true"/>
<!-- location for geospatial search -->
<dynamicField name="*____loc" type="location" indexed="true" stored="true"/>
<dynamicField name="*____loc_0_coordinate" type="double" indexed="true" stored="true"/>
<dynamicField name="*____loc_1_coordinate" type="double" indexed="true" stored="true"/>
<!-- storage fields accepts base64 encoded strings -->
<dynamicField name="*____bst" type="binary" indexed="false" stored="true" multiValued="true"/>

Expand Down
1 change: 1 addition & 0 deletions settings/ezfind.ini
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ CustomMap[ezobjectrelation]=ezfSolrDocumentFieldObjectRelation
CustomMap[ezobjectrelationlist]=ezfSolrDocumentFieldObjectRelation
CustomMap[ezxmltext]=ezfSolrDocumentFieldXML
CustomMap[ezmatrix]=ezfSolrDocumentFieldXML
CustomMap[ezgmaplocation]=ezfSolrDocumentFieldGmapLocation

# since eZ Find 2.3
# in case eztext attributes are used to store also (partial) html markup
Expand Down