Inheritance: IFieldable
		public override AbstractField[] CreateIndexableFields(Shape shape)
		{
			var point = shape as Point;
			if (point != null)
			{
				var f = new AbstractField[2];

				var f0 = new NumericField(fieldNameX, precisionStep, Field.Store.NO, true)
				         	{OmitNorms = true, OmitTermFreqAndPositions = true};
				f0.SetDoubleValue(point.GetX());
				f[0] = f0;

				var f1 = new NumericField(fieldNameY, precisionStep, Field.Store.NO, true)
				         	{OmitNorms = true, OmitTermFreqAndPositions = true};
				f1.SetDoubleValue(point.GetY());
				f[1] = f1;

				return f;
			}
			if (!ignoreIncompatibleGeometry)
			{
				throw new ArgumentException("TwoDoublesStrategy can not index: " + shape);
			}
			return new AbstractField[0]; // nothing (solr does not support null) 
		}
Esempio n. 2
0
 public AbstractField[] CreateIndexableFields(Rectangle bbox)
 {
     var fields = new AbstractField[5];
     fields[0] = DoubleField(field_minX, bbox.GetMinX());
     fields[1] = DoubleField(field_maxX, bbox.GetMaxX());
     fields[2] = DoubleField(field_minY, bbox.GetMinY());
     fields[3] = DoubleField(field_maxY, bbox.GetMaxY());
     fields[4] = new Field(field_xdl, bbox.GetCrossesDateLine() ? "T" : "F", Field.Store.NO,
                           Field.Index.NOT_ANALYZED_NO_NORMS) {OmitNorms = true, OmitTermFreqAndPositions = true};
     return fields;
 }
Esempio n. 3
0
        public AbstractField[] CreateIndexableFields(Point point)
        {
                var f = new AbstractField[2];

                var f0 = new NumericField(fieldNameX, precisionStep, Field.Store.NO, true)
                             {OmitNorms = true, OmitTermFreqAndPositions = true};
                f0.SetDoubleValue(point.GetX());
                f[0] = f0;

                var f1 = new NumericField(fieldNameY, precisionStep, Field.Store.NO, true)
                             {OmitNorms = true, OmitTermFreqAndPositions = true};
                f1.SetDoubleValue(point.GetY());
                f[1] = f1;

                return f;
        }