Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

v1.0.4

  • Loading branch information...
commit ae785fa5e2c31ec1b5ae5fdcafe182992aaa488b 1 parent 238b3eb
@dsmiley authored
View
24 README.txt
@@ -1,7 +1,16 @@
Author: David Smiley
+You may find supplemental instructions online:
+http://wiki.apache.org/solr/SpatialSearch#SOLR-2155
+
Instructions:
+First, you will need to build the jar file from source if the jar wasn't provided.
+This is as simple as running "mvn install" which generates a jar file: target/Solr2155-1.0.3.jar
+Put that on Solr's classpath similar to how other Solr contrib jars are installed.
+
+Now edit some config files.
+
schema.xml:
<fieldType name="geohash" class="solr2155.solr.schema.GeoHashField" length="12" />
@@ -21,3 +30,18 @@ Instructions:
initialSize="1"
autowarmCount="1"/>
+At this point you can use Solr's {!geofilt}, {!bbox}, and {!geodist} as documented. You can also use
+{!gh_geofilt} like so: so (args are in west,south,east,north order):
+ fq={!gh_geofilt sfield=store box="-98,35,-97,36"}
+For further info on gh_geofilt, see the well-documented source.
+
+CHANGES
+
+ 1.0.4: Fixed bug in which geohashes were returned from Solr xml responses instead of lat,lon. Enhanced README.txt
+ and Solr wiki.
+
+ 1.0.3: * exception text for the absent sfield local param;
+ * add cache enabling recommendation into README.txt (cache name is confusing a little)
+ * fix for UnsupportedOpEx on debugQuery=on for geodist func (but my toString() impl seems overcomplicated)
+
+ 1.0.2: (first public release)
View
26 pom.xml
@@ -6,32 +6,42 @@
<groupId>Solr2155</groupId>
<artifactId>Solr2155</artifactId>
- <version>1.0.3</version>
+ <version>1.0.4</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- FYI this project is compatible with all known Solr 3.x releases -->
+ <solr.version>3.5.0</solr.version>
</properties>
+ <developers>
+ <developer>
+ <name>David Smiley</name>
+ <email>dsmiley@apache.org</email>
+ </developer>
+ </developers>
+
<dependencies>
- <dependency>
- <groupId>org.apache.solr</groupId>
- <artifactId>solr-core</artifactId>
- <version>3.4.0</version>
- </dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-test-framework</artifactId>
- <version>3.4.0</version>
+ <version>${solr.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
- <version>3.4.0</version>
+ <version>${solr.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-core</artifactId>
+ <version>${solr.version}</version>
+ </dependency>
+
</dependencies>
<build>
View
13 src/main/java/solr2155/solr/schema/GeoHashField.java
@@ -64,7 +64,7 @@
*/
public class GeoHashField extends FieldType implements SpatialQueryable {
- public static final int DEFAULT_LENGTH = GridNode.GridReferenceSystem.getMaxPrecision();//~12
+ public static final int DEFAULT_LENGTH = GridNode.GridReferenceSystem.getMaxPrecision();//~22
private GridNode.GridReferenceSystem gridReferenceSystem;
@Override
@@ -75,7 +75,6 @@ protected void init(IndexSchema schema, Map<String, String> args) {
CharFilterFactory[] filterFactories = new CharFilterFactory[0];
TokenFilterFactory[] tokenFilterFactories = new TokenFilterFactory[0];
analyzer = new TokenizerChain(filterFactories, new BaseTokenizerFactory() {
- @Override
public Tokenizer create(Reader input) {
return new EdgeNGramTokenizer(input, EdgeNGramTokenizer.Side.FRONT, 1, Integer.MAX_VALUE);
}
@@ -118,14 +117,14 @@ public void write(TextResponseWriter writer, String name, Fieldable f)
}
@Override
- public String toExternal(Fieldable f) {
- double[] xy = gridReferenceSystem.decodeXY(f);
- return xy[1] + "," + xy[0];
+ public void write(XMLWriter xmlWriter, String name, Fieldable f) throws IOException {
+ xmlWriter.writeStr(name, toExternal(f));
}
@Override
- public void write(XMLWriter xmlWriter, String name, Fieldable f) throws IOException {
- xmlWriter.writeStr(name, f.stringValue());
+ public String toExternal(Fieldable f) {
+ double[] xy = gridReferenceSystem.decodeXY(f);
+ return xy[1] + "," + xy[0];
}
@Override
Please sign in to comment.
Something went wrong with that request. Please try again.