ArangoDB-Community / ArangoBnB

16 stars 3 forks source link

Backend: View Creation #9

Open cw00dw0rd opened 3 years ago

cw00dw0rd commented 3 years ago

Need to determine the most appropriate view creation that will support desired AQL queries. Will need to come after query decisions.

Simran-B commented 3 years ago

Analyzers

Geo

arangosh:

db._useDatabase("arangobnb");
var analyzers = require("@arangodb/analyzers");
analyzers.save("geo", "geojson", {}, []) // properties and features?

Views

Main

What should we call it? arangobnb?

{
  "links": {
    "listings": {
      "analyzers": [
        "identity"
      ],
      "fields": {
        "description": {
          "analyzers": [
            "text_en"
          ]
        },
        "amenities": {
          "analyzers": [
            "text_en",
            "identity"
          ]
        },
        "room_type": {},
        "location": {
          "analyzers": [
            "geo"
          ]
        },
        "host_id": {},
        "price": {}
      }
    }
  }
}

links.listings.analyzers defined the default Analyzer, i.e. the one which is used for the fields without explicit analyzers attribute (e.g. "price": {}).

cw00dw0rd commented 3 years ago

Need to update to include GeoJSON point https://github.com/cw00dw0rd/ArangoBnB/issues/16#issuecomment-774420455

Simran-B commented 3 years ago

Should always include _analyzers system collection in dump. Could use exclude/full masking types: https://www.arangodb.com/docs/stable/programs-arangodump-maskings.html#masking-types