Hi Gregg
maybe you miss $spatial arg in your query
try this
select * from Port where [LATITUDE,LONGITUDE,$spatial] NEAR
[32.783333,-79.916667,{"maxDistance":100000}];
Enrico
2014-07-28 17:06 GMT+02:00 Gregg Hanold <[email protected]>:
> I am working though a Spatial example, but when I query the class, with
> NEAR, no results are found where at least one should be:
>
> I created a database wpi, then loaded the ports into a Class Port. The
> Port has a PORT_NAME, LATITUDE, and LONGITUDE.
> Then I created a Lucene Full Text Index on PORT_NAME
> orientdb {wpi}> create index Port.PORT_NAME on Port(PORT_NAME) fulltext
> engine lucene;
>
> Creating index...
> Created index successfully with 3687 entries in 1.457000 sec(s).
>
> Index created successfully
>
> Then test with:
> orientdb {wpi}> select PORT_NAME,LATITUDE,LONGITUDE FROM Port WHERE
> PORT_NAME LUCENE "CHARLESTON*"
>
> ----+-----+----------+---------+----------
> # |@RID |PORT_NAME |LATITUDE |LONGITUDE
> ----+-----+----------+---------+----------
> 0 |#-2:1|CHARLESTON|32.783333|-79.916667
> ----+-----+----------+---------+----------
>
> 1 item(s) found. Query executed in 0.004 sec(s).
>
> Then created spatial index on Latitude and Longitude
>
> orientdb {wpi}> create index Port.LAT_LONG on Port(LATITUDE,LONGITUDE)
> spatial engine lucene;
>
> Creating index...
> Created index successfully with 3687 entries in 1.943000 sec(s).
>
> Index created successfully
>
> Then test spatial index with results from Fulltext above.
> orientdb {wpi}> select * from Port where [LATITUDE,LONGITUDE,] NEAR
> [32.783333,-79.916667];
>
>
> 0 item(s) found. Query executed in 0.042 sec(s).
> orientdb {wpi}> select * from Port where [LATITUDE,LONGITUDE,] NEAR
> [32.783333,-79.916667{"maxDistance":100000}];
>
>
> 0 item(s) found. Query executed in 1.29 sec(s).
>
> Verify class
> orientdb {wpi}> info class Port
>
> Class................: Port
> Super class..........: V
> Default cluster......: port (id=11)
> Supported cluster ids: [11]
> Cluster selection....: round-robin
>
> PROPERTIES
>
> -------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+
> NAME | TYPE | LINKED TYPE/CLASS
> | MANDATORY | READONLY | NOT NULL | MIN | MAX | COLLATE |
>
> -------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+
> COMM_VHF | STRING | null
> | false | false | false | | | default |
> DEGAUSS | STRING | null
> | false | false | false | | | default |
> COMM_RAIL | STRING | null
> | false | false | false | | | default |
> ENTRY_TIDE | STRING | null
> | false | false | false | | | default |
> INDEX_NO | STRING | null
> | false | false | false | | | default |
> GARBAGE | STRING | null
> | false | false | false | | | default |
> ANCH_DEPTH | STRING | null
> | false | false | false | | | default |
> OIL_DEPTH | STRING | null
> | false | false | false | | | default |
> OVERHD_LIM | STRING | null
> | false | false | false | | | default |
> PROVISIONS | STRING | null
> | false | false | false | | | default |
> PORTOFENTR | STRING | null
> | false | false | false | | | default |
> SHELTER | STRING | null
> | false | false | false | | | default |
> LIFT50_100 | STRING | null
> | false | false | false | | | default |
> LIFT_100_ | STRING | null
> | false | false | false | | | default |
> ENTRY_ICE | STRING | null
> | false | false | false | | | default |
> NAV_EQUIP | STRING | null
> | false | false | false | | | default |
> LONGITUDE | DOUBLE | null
> | false | false | false | | | default |
> COMM_FAX | STRING | null
> | false | false | false | | | default |
> TIDE_RANGE | STRING | null
> | false | false | false | | | default |
> ENTRYSWELL | STRING | null
> | false | false | false | | | default |
> LAT_MIN | STRING | null
> | false | false | false | | | default |
> CARGMDMOOR | STRING | null
> | false | false | false | | | default |
> DRTYBALLST | STRING | null
> | false | false | false | | | default |
> REGION_NO | STRING | null
> | false | false | false | | | default |
> QUAR_OTHER | STRING | null
> | false | false | false | | | default |
> CRANEFIXED | STRING | null
> | false | false | false | | | default |
> PRATIQUE | STRING | null
> | false | false | false | | | default |
> COMM_PHONE | STRING | null
> | false | false | false | | | default |
> HOLDGROUND | STRING | null
> | false | false | false | | | default |
> PUB | STRING | null
> | false | false | false | | | default |
> LAT_DEG | STRING | null
> | false | false | false | | | default |
> COUNTRY | STRING | null
> | false | false | false | | | default |
> LONG_DEG | STRING | null
> | false | false | false | | | default |
> COMM_AIR | STRING | null
> | false | false | false | | | default |
> RAILWAY | STRING | null
> | false | false | false | | | default |
> CARGODEPTH | STRING | null
> | false | false | false | | | default |
> US_REP | STRING | null
> | false | false | false | | | default |
> HARBORSIZE | STRING | null
> | false | false | false | | | default |
> TURN_BASIN | STRING | null
> | false | false | false | | | default |
> LATITUDE | DOUBLE | null
> | false | false | false | | | default |
> CARICEMOOR | STRING | null
> | false | false | false | | | default |
> CHAN_DEPTH | STRING | null
> | false | false | false | | | default |
> LOC_ASSIST | STRING | null
> | false | false | false | | | default |
> LONGSHORE | STRING | null
> | false | false | false | | | default |
> COMM_RADIO | STRING | null
> | false | false | false | | | default |
> LIFT_25_49 | STRING | null
> | false | false | false | | | default |
> MED_FACIL | STRING | null
> | false | false | false | | | default |
> CARGO_ANCH | STRING | null
> | false | false | false | | | default |
> CRANEFLOAT | STRING | null
> | false | false | false | | | default |
> CARGOWHARF | STRING | null
> | false | false | false | | | default |
> TUG_ASSIST | STRING | null
> | false | false | false | | | default |
> LONG_HEMI | STRING | null
> | false | false | false | | | default |
> CARBCHMOOR | STRING | null
> | false | false | false | | | default |
> LAT_HEMI | STRING | null
> | false | false | false | | | default |
> DRYDOCK | STRING | null
> | false | false | false | | | default |
> DECKSUPPLY | STRING | null
> | false | false | false | | | default |
> PILOTAVAIL | STRING | null
> | false | false | false | | | default |
> WATER | STRING | null
> | false | false | false | | | default |
> MAX_VESSEL | STRING | null
> | false | false | false | | | default |
> ETAMESSAGE | STRING | null
> | false | false | false | | | default |
> LONG_MIN | STRING | null
> | false | false | false | | | default |
> LIFT_0_24 | STRING | null
> | false | false | false | | | default |
> SERV_STEAM | STRING | null
> | false | false | false | | | default |
> PILOT_REQD | STRING | null
> | false | false | false | | | default |
> TUGSALVAGE | STRING | null
> | false | false | false | | | default |
> CRANEMOBIL | STRING | null
> | false | false | false | | | default |
> DIESEL | STRING | null
> | false | false | false | | | default |
> PORT_NAME | STRING | null
> | false | false | false | | | default |
> PILOTADVSD | STRING | null
> | false | false | false | | | default |
> ELECTRICAL | STRING | null
> | false | false | false | | | default |
> ELECREPAIR | STRING | null
> | false | false | false | | | default |
> HARBORTYPE | STRING | null
> | false | false | false | | | default |
> SSCC_CERT | STRING | null
> | false | false | false | | | default |
> FUEL_OIL | STRING | null
> | false | false | false | | | default |
> CHART | STRING | null
> | false | false | false | | | default |
> ENTRYOTHER | STRING | null
> | false | false | false | | | default |
> REPAIRCODE | STRING | null
> | false | false | false | | | default |
> ENG_SUPPLY | STRING | null
> | false | false | false | | | default |
>
> -------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+
>
> INDEXES (2 altogether)
> -------------------------------+----------------+
> NAME | PROPERTIES |
> -------------------------------+----------------+
> Port.PORT_NAME | PORT_NAME |
> Port.LAT_LONG | LATITUDE (+) |
> | LONGITUDE |
> -------------------------------+----------------+
>
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.